Templ. lang.: How to check content object attribute values?

Templ. lang.: How to check content object attribute values?

Monday 16 February 2009 6:41:17 am - 2 replies

Author Message

Helle Andersen

Monday 16 February 2009 7:34:22 am

Hi Ron
It depends on the datatype of the attribute:

XML attribut:e

{if $node.object.data_map.arbejdsomraade.content.is_empty|not}
<h1>Arbejdsomraade:</h1>
{attribute_view_gui attribute=$node.object.data_map.arbejdsomraade}
{/if}

Text line, images, emails and URL attribut:e

{if $node.object.data_map.fornavn.content}
        <strong>{attribute_view_gui attribute=$node.object.data_map.fornavn}</strong>
{/if}

Image example:

{if $node.object.data_map.billede.content}
<img align="right ..>
{/if}

Matrix:

{if $node.object.data_map.xx.content.rows.sequential}
{attribute_view_gui attribute=$node.object.data_map.xx}
{/if}

ISBN:

{if $object.data_map.isbn.content|not}
{/if}

Time-date field

{if $node.object.data_map.sluttidspunkt.content.is_valid}
{/if}

Object relation (only one option)

{if $node.object.data_map.xxxx.content}
{attribute_view_gui attribute=$node.object.data_map.xxxx}
{/if}

Object relation list

{if $node.object.data_map.xxx.content.relation_list|count|gt( 0 )}
{attribute_view_gui attribute=$node.object.data_map.xxx}
{/if}

Don Ronaldo

Monday 16 February 2009 8:48:24 am

Hi Helle,

thanks a lot. Exactly, what I was looking for!

cheers,
Ron.

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.