How do I create an IF Then Statement

Author Message

Clay Pereira

Thursday 19 February 2004 4:12:48 pm

How do and if null case
Example:

IF $node.object.data_map.author <> Null
<h3>By:{attribute_view_gui attribute=$node.object.data_map.author}</h3>
else <h3>No Author</h3>

Sorry For the newbie Question. Can't figure out how to check variables.

Clay Pereira

Thursday 19 February 2004 4:43:50 pm

I don't know if I am one the right track... This is what I have tried so far....

{switch match=$node.object.data_map.author.data_text}
{case match=""}
<h3>By:{attribute_view_gui attribute=$node.object.data_map.author}</h3>
{/case}
{/switch}

Clay Pereira

Thursday 19 February 2004 5:28:35 pm

I tried this too....

{section show=$node.object.data_map.author|null( )
<h3>By:{attribute_view_gui attribute=$node.object.data_map.author}</h3>
{/section}

Clay Pereira

Thursday 19 February 2004 6:22:29 pm

Well I figured it out after all. Here is what I did.

{section show=ne($node.object.data_map.author.content)}
<h3>By:{attribute_view_gui attribute=$node.object.data_map.author}</h3>
{/section}

Marko Pohl

Friday 20 February 2004 12:41:28 am

have a look at this:

http://ez.no/ez_publish/documentation/development/libraries/ez_template/operators/control_structure_handling

But i think this is only suitable for 'tiny' conditions...

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 31 2025 01:30:29
Script start
Timing: Jan 31 2025 01:30:30
Module start 'layout'
Timing: Jan 31 2025 01:30:30
Module start 'content'
Timing: Jan 31 2025 01:30:30
Module end 'content'
Timing: Jan 31 2025 01:30:30
Script end

Main resources:

Total runtime0.0475 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 588.2500151.2266
Module start 'layout' 0.00820.0047 739.4766220.7188
Module start 'content' 0.01290.0325 960.1953997.6953
Module end 'content' 0.04540.0021 1,957.890633.9922
Script end 0.0475  1,991.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00316.4301140.0002
Check MTime0.00132.7173140.0001
Mysql Total
Database connection0.00102.093710.0010
Mysqli_queries0.005210.920030.0017
Looping result0.00000.039610.0000
Template Total0.00132.710.0013
Template load0.00102.201110.0010
Template processing0.00020.437510.0002
Override
Cache load0.00071.513210.0007
General
dbfile0.015031.502280.0019
String conversion0.00000.021140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs