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.