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}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 03:25:04
Script start
Timing: Jan 19 2025 03:25:04
Module start 'layout'
Timing: Jan 19 2025 03:25:04
Module start 'content'
Timing: Jan 19 2025 03:25:06
Module end 'content'
Timing: Jan 19 2025 03:25:06
Script end

Main resources:

Total runtime1.4507 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.1563152.6250
Module start 'layout' 0.00590.0035 741.781339.4453
Module start 'content' 0.00941.4398 781.2266456.0156
Module end 'content' 1.44920.0014 1,237.24228.1641
Script end 1.4507  1,245.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2296160.0002
Check MTime0.00130.0910160.0001
Mysql Total
Database connection0.00090.058810.0009
Mysqli_queries1.400296.5229460.0304
Looping result0.00040.0299440.0000
Template Total1.415397.620.7077
Template load0.00190.129620.0009
Template processing1.413497.432320.7067
Template load and register function0.00010.008010.0001
states
state_id_array0.00080.053210.0008
state_identifier_array0.00380.259120.0019
Override
Cache load0.00160.1098560.0000
Sytem overhead
Fetch class attribute can translate value0.00080.051810.0008
Fetch class attribute name0.00100.071320.0005
XML
Image XML parsing0.00050.034810.0005
class_abstraction
Instantiating content class attribute0.00000.000320.0000
General
dbfile0.00090.0611160.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs