The switch function. Can't manage to print correctly the different cases.

Author Message

laurent le cadet

Thursday 02 October 2003 8:45:48 am

Hi,

I'm trying to understand how the switch function works.

I have writen this :

{switch name=Sw match=$node.data_map.tit_graph}
{case match="<p></p>"}
 
{/case}
{case match=""}
 
{/case}
{case}
<h4>{attribute_view_gui attribute=$content_version.data_map.tit_graph}</h4>
{/case}
{/switch}

but it don't seems to be ok... :-(

What I want is to print the content of an item of the data_map (tit_graph) in my <h4> style but even if the text field or xml field in my classe is empty (case <p></p> or "") it print an empty <h4> style.

Normally it should be empty, isn't it ?

Laurent

Alex Jones

Thursday 02 October 2003 10:06:18 am

Perhaps try using $node.data_map.tit_graph.content or perhaps $node.data_map.tit_graph.output If nothing else, I would recommend looking at the attributes to see what you should be trying to match: {$node|attributes(show)}

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

laurent le cadet

Thursday 02 October 2003 10:33:01 am

Thanks Alex,

$node.data_map.tit_graph.content

works fine.

Laurent.

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 01:12:57
Script start
Timing: Jan 19 2025 01:12:57
Module start 'layout'
Timing: Jan 19 2025 01:12:57
Module start 'content'
Timing: Jan 19 2025 01:12:58
Module end 'content'
Timing: Jan 19 2025 01:12:58
Script end

Main resources:

Total runtime0.6991 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.6484152.6875
Module start 'layout' 0.00580.0037 742.335939.5234
Module start 'content' 0.00950.6882 781.8594537.8594
Module end 'content' 0.69770.0014 1,319.718812.0625
Script end 0.6991  1,331.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4578160.0002
Check MTime0.00130.1908160.0001
Mysql Total
Database connection0.00080.115210.0008
Mysqli_queries0.644992.2451570.0113
Looping result0.00100.1374550.0000
Template Total0.668795.720.3344
Template load0.00210.294120.0010
Template processing0.666795.358520.3333
Template load and register function0.00010.013310.0001
states
state_id_array0.00140.198510.0014
state_identifier_array0.00090.127020.0004
Override
Cache load0.00170.2377320.0001
Sytem overhead
Fetch class attribute can translate value0.00060.079020.0003
Fetch class attribute name0.00160.226150.0003
XML
Image XML parsing0.00090.129220.0005
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00080.1207220.0000
String conversion0.00000.002340.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs