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.