Selection attribute ..has_content?

Author Message

Lo' F.

Tuesday 29 March 2011 3:32:00 pm

Hi there,

I need to display the content of the attributes of a class only if they have some content.

Like for a text field it can be achieved this way..

{if $node.data_map.xxx.has_content}...

How can I check if a selection attribute has content or not?

The first option of the selection attribute is left empty, while the others have some values. If that is the one selected then what's inside the condition doesn't have to be showed.

loredanaebook.it

Gabriel Finkelstein

Tuesday 29 March 2011 8:01:02 pm

A selection attribute has always content. What you can do is check if that content is empty, like this:

{if $node.data_map.xxx.content.0}...

Lo' F.

Wednesday 30 March 2011 2:22:25 am

"

A selection attribute has always content. What you can do is check if that content is empty, like this:

{if $node.data_map.xxx.content.0}...
"

Gabriel, thank you so much!

loredanaebook.it

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 18 2025 10:58:58
Script start
Timing: Jan 18 2025 10:58:58
Module start 'layout'
Timing: Jan 18 2025 10:58:58
Module start 'content'
Timing: Jan 18 2025 10:59:00
Module end 'content'
Timing: Jan 18 2025 10:59:00
Script end

Main resources:

Total runtime1.4498 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 587.9141152.6250
Module start 'layout' 0.00580.0031 740.539139.4531
Module start 'content' 0.00891.4395 779.9922539.7031
Module end 'content' 1.44840.0013 1,319.695312.4688
Script end 1.4497  1,332.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2177160.0002
Check MTime0.00130.0867160.0001
Mysql Total
Database connection0.00090.059710.0009
Mysqli_queries1.394196.1642570.0245
Looping result0.00060.0385550.0000
Template Total1.412697.420.7063
Template load0.00220.155020.0011
Template processing1.410397.280320.7052
Template load and register function0.00010.007310.0001
states
state_id_array0.00170.118710.0017
state_identifier_array0.00190.132220.0010
Override
Cache load0.00190.1320200.0001
Sytem overhead
Fetch class attribute can translate value0.00040.026220.0002
Fetch class attribute name0.00200.136150.0004
XML
Image XML parsing0.00180.126220.0009
class_abstraction
Instantiating content class attribute0.00000.000760.0000
General
dbfile0.00220.1534220.0001
String conversion0.00000.000640.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs