Forums / Developer / switch - match - case problem

switch - match - case problem

Author Message

Niklas Gunnäs

Thursday 16 March 2006 12:12:49 am

Have this two switches in an template that is trying to get an value by useing $Child:item.object.data_map.typ.contentclass_attribute.content.options[$:item.object.data_map.typ.content[0]].name and if its the right value it should show an image. The problem is that it dont show the right image. Can someone help me, please :-)

{section name=Child loop=$children sequence=array(bglight,bgdark)}

<tr class="{$Child:sequence}">

<td width=15 align="center">
{switch match=$Child:item.object.data_map.typ.contentclass_attribute.content.options[$:item.object.data_map.typ.content[0]].name}

{case match='Tech'}
{switch match=$Child:item.object.data_map.prioritet.contentclass_attribute.content.options[$:item.object.data_map.prioritet.content[0]].name}
{case match='high'}
<img src={"thog.png"|ezimage} >
{/case}
{case match='Medium'}
<img src={"tmellan.png"|ezimage} >
{/case}
{case match='low'}
<img src={"tlag.png"|ezimage} >
{/case}
{/switch}
{/case}

{case match='com'}
{switch match=$Child:item.object.data_map.prioritet.contentclass_attribute.content.options[$:item.object.data_map.prioritet.content[0]].name}
{case match='high'}
<img src={"ovhog.png"|ezimage}>
{/case}
{case match='medium'}
<img src={"ovmellan.png"|ezimage}>
{/case}
{case match='low'}
<img src={"ovlag.png"|ezimage}>
{/case}
{/switch}
{/case}
{/switch}
</td>

<td>
{switch name=status match=$Child:item.object.data_map.status.contentclass_attribute.content.options[$:item.object.data_map.status.content[0]].name}
{case match='10%'}
<img src={"status10.gif"|ezimage} alt="2" align="absmiddle">  {attribute_view_gui attribute=$Child:item.object.data_map.status}
{/case}

{case match='20%'}
<img src={"status20.gif"|ezimage} alt="3" align="absmiddle">  {attribute_view_gui attribute=$Child:item.object.data_map.status}
{/case}

{case match='30%'}
<img src={"status30.gif"|ezimage} alt="4" align="absmiddle">  {attribute_view_gui attribute=$Child:item.object.data_map.status}
{/case}

{case match='40%'}
<img src={"status40.gif"|ezimage} alt="5" align="absmiddle">  {attribute_view_gui attribute=$Child:item.object.data_map.status}
{/case}

{/switch}
</td>

</tr>
{/section}