Tuesday 24 August 2004 3:22:53 pm
I need to do different things based on what is stored in a Single Choice drop down-list. For testing, I've tried to display a simple number to indicate what switch gets used:
{section show=$node.object.data_map.sivilstatus.content}
{switch match=$node.object.data_map.sivilstatus}
{case match=0}
<tr><td class="label"><b>0Sivilstatus:</b></td><td class="element">{attribute_view_gui attribute=$node.object.data_map.sivilstatus}</td></tr>
{/case}
{case match=1}
<tr><td class="label"><b>1Sivilstatus:</b></td><td class="element">{attribute_view_gui attribute=$node.object.data_map.sivilstatus}</td></tr>
{/case}
{case match=2}
<tr><td class="label"><b>2Sivilstatus:</b></td><td class="element">{attribute_view_gui attribute=$node.object.data_map.sivilstatus}</td></tr>
{/case}
{case match=3}
<tr><td class="label"><b>3Sivilstatus:</b></td><td class="element">{attribute_view_gui attribute=$node.object.data_map.sivilstatus}</td></tr>
{/case}
{case}
<tr><td class="label"><b>4Sivilstatus:</b></td><td class="element">{attribute_view_gui attribute=$node.object.data_map.sivilstatus}</td></tr>
{/case}
{/switch}
{/section}
It displays number 4 all the time - The default - Which means that none of the switches gets initaied. I've also tried matching on the text that gets output, but that doesn't seem to work either. Any ideas?
|