Wednesday 07 January 2004 9:22:56 am
Hi I have several content objects of various classes, all having an image in an attribute called "ingress". In my templates I need to do different stuff depending upon whereever there actually is an image in the ingress attribute or not. To do this I am using this code. But I have the feeling that it might not be the best solution. So does anyone else have any tips or ideas about how to do it?
{section show=is_boolean($node.object.data_map.ingress.content)}
There is an image in ingress
{section-else}
There is not an image in ingress {/section} I tried with is_null, but even if there weren't an image ingress.content was still different from null. I think there should be some better functionality to check for actual content in an attribute in EZ.
Cheers Tore Update: Found this thread (http://www.ez.no/developer/ez_publish_3/forum/setup_design/displaying_content_if_there_is_content_) dealing with the same problem. Out from that I used this: {section show=$node.object.data_map.ingress.content)} But I still feel like this is a very rude and ad hoc way to basically check if an attribute!=null! Are'nt there any better ways to do it?
|