Set a condition on the value of an attribute

Author Message

M M

Tuesday 10 May 2005 8:43:57 am

Hi all

Please I need your help in the folloewing problem...

I need to make a condition on the existance of a value in an attribute

* when there is no content in this attribute, Display image 1

* when there is content in this attribute, Display image 2

Now I'm using the following code but it do nothing

{Section show=$parent.object.data_map.site_image.content.is_empty|not}

{attribute_view_gui attribute=$parent.object.data_map.site_image}

{Section-else}

{attribute_view_gui attribute=$grand.data_map.site_image}

{/section}

where the variables grand and parent are pre defined

and site_image is the attribute's identifier

Thanks in advance

Mads Ovesen

Wednesday 11 May 2005 2:33:53 am

Try:

{section show=$parent.object.data_map.site_image.content}
{attribute_view_gui attribute=$parent.object.data_map.site_image.content.data_map.image}
{section-else}
{attribute_view_gui attribute=$grand.object.data_map.site_image.content.data_map.image}
{/section}

- Mads

/m

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 31 2025 04:13:57
Script start
Timing: Jan 31 2025 04:13:57
Module start 'layout'
Timing: Jan 31 2025 04:13:57
Module start 'content'
Timing: Jan 31 2025 04:13:57
Module end 'content'
Timing: Jan 31 2025 04:13:57
Script end

Main resources:

Total runtime0.0145 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.2656151.2266
Module start 'layout' 0.00470.0020 739.492236.6797
Module start 'content' 0.00670.0066 776.171990.1094
Module end 'content' 0.01340.0011 866.281329.9922
Script end 0.0145  896.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.1220140.0002
Check MTime0.00117.5652140.0001
Mysql Total
Database connection0.00085.435410.0008
Mysqli_queries0.001812.471030.0006
Looping result0.00000.069110.0000
Template Total0.00085.610.0008
Template load0.00064.443710.0006
Template processing0.00021.166010.0002
Override
Cache load0.00042.869810.0004
General
dbfile0.002920.031280.0004
String conversion0.00000.032940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs