another newbie question: how do I perform selective displaying of content

another newbie question: how do I perform selective displaying of content

Thursday 29 January 2004 12:04:17 pm - 4 replies

Author Message

Eirik Alfstad Johansen

Friday 30 January 2004 1:12:48 am

Hi Nick,

Check out the section template function and the show parameter:

http://www.ez.no/ez_publish/documentation/development/libraries/ez_template/functions/section

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Nick Woods

Friday 30 January 2004 5:23:06 am

Thanks Eirik, it looks like all i have to do is something like this. I'm assuming that the 'body' field in my example will be null if it has no data, otheriwse I need to find another way of doing it

{section name="body" show=$node.object.data_map.body}
<tr><td>etc etc etc</td></tr>
{/section}

Eirik Alfstad Johansen

Friday 30 January 2004 5:45:12 am

Hi,

You might need to use some operator, depending on which datatype the body attribute is built upon. Read up on the is_set operator and other operators here:

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

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Nick Woods

Sunday 01 February 2004 3:53:27 am

After a lot of messing about I ended up with this for text fields (where intro is the name of my field) :-

{section show=ne($node.object.data_map.intro.content.output.output_text | trim | count_chars,0)}

and for images this seems to work :-

{let image_1_Content=$node.data_map.image_1.content}
{section show=$image_1_Content.is_valid}

You must be logged in to post messages in this topic!

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