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.

eZ debug

Timing: Jan 19 2025 06:23:48
Script start
Timing: Jan 19 2025 06:23:48
Module start 'layout'
Timing: Jan 19 2025 06:23:48
Module start 'content'
Timing: Jan 19 2025 06:23:48
Module end 'content'
Timing: Jan 19 2025 06:23:48
Script end

Main resources:

Total runtime0.7068 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.1563152.6250
Module start 'layout' 0.00580.0023 741.781339.4453
Module start 'content' 0.00810.6971 781.2266525.6563
Module end 'content' 0.70530.0015 1,306.88288.1641
Script end 0.7067  1,315.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4565160.0002
Check MTime0.00130.1810160.0001
Mysql Total
Database connection0.00110.154410.0011
Mysqli_queries0.666094.2362540.0123
Looping result0.00040.0604520.0000
Template Total0.682196.520.3410
Template load0.00200.284120.0010
Template processing0.680096.218620.3400
Template load and register function0.00020.025610.0002
states
state_id_array0.00070.096410.0007
state_identifier_array0.00080.115420.0004
Override
Cache load0.00160.2276150.0001
Sytem overhead
Fetch class attribute can translate value0.00090.129720.0005
Fetch class attribute name0.00090.124130.0003
XML
Image XML parsing0.00060.089720.0003
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00070.0976180.0000
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs