Forums / General / Use of is_empty with keywords attribute

Use of is_empty with keywords attribute

Author Message

Patrice DUCLAUD

Friday 01 April 2005 5:49:32 am

i've created a classe with an attribute 'keywords'(mykeyword)
and i'd like to do something (show his content) only when he is not empty.
this code does not work ...
{section show=&node.object.data_map.mykeyword.is_empty|not()}
code to show the content of $node.object.data_map.keyword ...
{/section}
any idea ...
Thanks

bisk

Friday 01 April 2005 6:34:38 am

I think it's because you've written &node and .content is missing.

try

{section show=$node.object.data_map.mykeyword.content.is_empty|not}
your tpl code...
{/section}

or

{section show=$node.object.data_map.mykeyword.has_content}
your tpl code...
{/section}

-------------------------------
http://www.kookfijn.nl & http://www.magento.be

Patrice DUCLAUD

Sunday 03 April 2005 11:34:56 pm

>I think it's because you've written &node
ok ... it's a mistake when i've written my question ;-(

In this case, code does not work for me
$node.object.data_map.mykeyword.content.is_empty|not

but Thanks for this code,
$node.object.data_map.mykeyword.has_content
It's work fine for me...;-)

eZ debug

Timing: Jan 18 2025 22:39:42
Script start
Timing: Jan 18 2025 22:39:42
Module start 'content'
Timing: Jan 18 2025 22:39:43
Module end 'content'
Timing: Jan 18 2025 22:39:43
Script end

Main resources:

Total runtime0.7047 sec
Peak memory usage4,096.0000 KB
Database Queries58

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 589.1719180.8359
Module start 'content' 0.00800.6908 770.0078503.6016
Module end 'content' 0.69890.0057 1,273.609442.1016
Script end 0.7046  1,315.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4756140.0002
Check MTime0.00130.1810140.0001
Mysql Total
Database connection0.00070.103610.0007
Mysqli_queries0.658293.4079580.0113
Looping result0.00060.0883560.0000
Template Total0.663194.120.3315
Template load0.00210.301320.0011
Template processing0.661093.799020.3305
Template load and register function0.00020.032910.0002
states
state_id_array0.00110.162210.0011
state_identifier_array0.00190.265620.0009
Override
Cache load0.00170.2475230.0001
Sytem overhead
Fetch class attribute can translate value0.00090.131420.0005
Fetch class attribute name0.00100.143730.0003
XML
Image XML parsing0.00030.048320.0002
class_abstraction
Instantiating content class attribute0.00000.001330.0000
General
dbfile0.00100.1437120.0001
String conversion0.00000.005130.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs