Image Availability

Author Message

SathishKumar Subramanian

Thursday 08 January 2004 9:43:20 pm

Hi,

I am publishing the an article's content in a table format.
The code is like
<table>
<tr>
<td>
{attribute_view_gui attribute=$content_version.data_map.thumbnail image_class=small}
</td>
<td align=left><b>{attribute_view_gui attribute=$content_version.data_map.title}</b><br/>
{$content_version.data_map.intro.data_text}
</td>
</tr>
</table>

Some articles may not have their image. In that situation I should avoid the first <td> which is used to show the image.

How can I achieve this? please help. :(

Thanx in advance.
Sathizh

Claus Jensen

Friday 09 January 2004 12:51:46 am

Hi Sathizh,
You could check to see wether that article's image attribute is an object(is_object). Check this: http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/type_handling

And this in the template will do it:
{section show=is_object($node.object.data_map.image.content)}
blablabla...etc
{section-else}
something else...
{/section}

Hope this helps.

regards,
claÜs

SathishKumar Subramanian

Friday 09 January 2004 1:17:10 am

Oh Great....

Thanks ClaÜs, Its working fine. Thanks a lot! :)

Sathizh

Tore Skobba

Friday 09 January 2004 6:53:51 am

Hi

If you are going to update to E 3.3 then note that the above solution might not work, i.e. is_object($node.object.data_map.image.content)}. Instead use {$node.object.data_map.image.content.is_valid}

Read here for more:
http://www.ez.no/developer/ez_publish_3/releases/ez_publish_3_3/new_image_system

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 01:11:13
Script start
Timing: Jan 19 2025 01:11:13
Module start 'layout'
Timing: Jan 19 2025 01:11:13
Module start 'content'
Timing: Jan 19 2025 01:11:14
Module end 'content'
Timing: Jan 19 2025 01:11:14
Script end

Main resources:

Total runtime1.1318 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.1328152.6094
Module start 'layout' 0.00770.0040 741.742239.4141
Module start 'content' 0.01181.1180 781.1563516.4844
Module end 'content' 1.12970.0020 1,297.640612.1875
Script end 1.1318  1,309.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.4007160.0003
Check MTime0.00190.1653160.0001
Mysql Total
Database connection0.00120.109410.0012
Mysqli_queries1.069594.4986620.0173
Looping result0.00080.0686600.0000
Template Total1.087196.020.5435
Template load0.00240.212020.0012
Template processing1.084795.833720.5423
Template load and register function0.00010.012410.0001
states
state_id_array0.00130.114510.0013
state_identifier_array0.00120.107920.0006
Override
Cache load0.00290.2571410.0001
Sytem overhead
Fetch class attribute can translate value0.00090.080230.0003
Fetch class attribute name0.00120.109840.0003
XML
Image XML parsing0.00040.031930.0001
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00100.0891100.0001
String conversion0.00000.001140.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs