Retrieve integer from field

Author Message

Daniel Guerrier

Tuesday 24 May 2005 6:32:50 pm

I am trying to do a simple integer comparison.

{section show=5|eq($node.object.data_map.rating|int)}
Show Me
{/section}

All I want to do is show something if the data in the integer field of my content class is equal to 5.

I tried with and without attribute view gui and with and with out the int operator.

The $node.object.data_map.rating|int portion always evalutes to the number one.

Thanks

Ɓukasz Serwatka

Tuesday 24 May 2005 11:44:18 pm

Hi Daniel,

Try with

{section show=eq(5, $node.object.data_map.rating.data_int)}
    Show Me
{/section}

If you want to display datatype value without attribute_view_gui it`s good look in to design\standard\templates\content\datatype\view\ dir.

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

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