Check the value of a field

Author Message

Philip K.

Wednesday 07 December 2005 8:16:52 am

Hi.

I have a little problem:
I want to check the value of a field in my class.

{if $node.object.data_map.<fieldname>.content = '<value>'}
  do this
{else}
  do this
{/if}

...but it doensn't work as I want it to work... any ideas??

There might be an easy way to do it, but I'm new in eZ and have some problems with it...

Thanks.

Linux is like a wigwam; no windows, now gates, and apache inside!

Ɓukasz Serwatka

Tuesday 13 December 2005 1:56:17 am

Hi Philip,

You were very close ;)

eZ publish tpl syntax uses operators for comparing values.

Look on this documentation page:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/logical_operations

Example for text string attribute:

{if eq( $node.object.data_map.<fieldname>.content.data_text, 'value' )} 
 do this 
{else} 
 do this 
{/if} 

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Philip K.

Tuesday 13 December 2005 7:45:57 am

thank you - works :)

Linux is like a wigwam; no windows, now gates, and apache inside!

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