Forums / Setup & design / Retrieve integer from field

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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