[show() 'error'] Check if $module_result.path[3][node_id] exists

Author Message

Mark Overduin

Friday 22 August 2003 6:22:57 am

I just want to check if $module_result.path[3][node_id] exists. If it does, show stuff1, if it doesn't, show stuff2.

I think I have to use some function 'show=$...|function(...)', but I really don't know what I should use...

- - - code - - -
{section name=NewSection show=$module_result.path[3][node_id]}
bla bla 1
{section-else}
{section name=ElseSection}
bla bla 2
{/section}
{/section}
- - - - - - - - -

Thanx in advance!

Mark Overduin

Monday 25 August 2003 12:31:27 am

Anyone?

Jan Borsodi

Tuesday 26 August 2003 6:50:07 am

Use the is_set operator to check for existance.
{section show=is_set($module_result.path[3][node_id])}
bla bla 1
{section-else]
bla bla 2
{/section}

or if you want to choose among many expression until you find one that exists you can use first_set, it will return the first parameter that exist.
{first_set($module_result.path[3][node_id],false())}
will return false (the second parameter) if no value exists.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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 18 2025 22:37:49
Script start
Timing: Jan 18 2025 22:37:49
Module start 'layout'
Timing: Jan 18 2025 22:37:49
Module start 'content'
Timing: Jan 18 2025 22:37:50
Module end 'content'
Timing: Jan 18 2025 22:37:50
Script end

Main resources:

Total runtime1.1034 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.0056 589.2734152.6563
Module start 'layout' 0.00560.0036 741.929739.5078
Module start 'content' 0.00921.0926 781.4375532.0703
Module end 'content' 1.10190.0015 1,313.50788.0938
Script end 1.1034  1,321.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3076160.0002
Check MTime0.00140.1246160.0001
Mysql Total
Database connection0.00060.052510.0006
Mysqli_queries1.056095.7029570.0185
Looping result0.00050.0461550.0000
Template Total1.070797.020.5354
Template load0.00210.187620.0010
Template processing1.068696.847920.5343
Template load and register function0.00010.011610.0001
states
state_id_array0.00180.165110.0018
state_identifier_array0.00160.144520.0008
Override
Cache load0.00170.1546280.0001
Sytem overhead
Fetch class attribute can translate value0.00050.046220.0003
Fetch class attribute name0.00100.088940.0002
XML
Image XML parsing0.00070.062220.0003
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00080.0722170.0000
String conversion0.00000.000940.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs