Forums / Setup & design / is_valid usage difficult, bug?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

is_valid usage difficult, bug?

Author Message

Tore Skobba

Tuesday 13 January 2004 4:26:34 am

Hi

I am using the new is_valid template operator. But I am having difficulties in using it.

It get this to work:
{let content=$node.data_map.image.content}
{section show=$content.is_valid}
We have an image.
{section-else}
No image has been uploaded.
{/section}
{/let}

But this does not work (using within an section loop going through several children):
{let content=$Child:item.data_map.thumbnail.content}
{section show=$content.is_valid}
IMAGE
<div class="image_left">{attribute_view_gui attribute=$Child:item.data_map.thumbnail image_class=small}</div>
{section-else}
NO IMAGE
{/section}
{/let}

In the above the {section-else} is never true, even if there is not an image.

Neither does this work (dropped the "let"):
{section show=$node.data_map.thumbnail.content.is_valid}
We have an image.
{section-else}
No image has been uploaded.
{/section}

This causes an fatal error. So now I am wondring if anyone else have experinced this, or am I using it wrong?

Cheers
Tore

Jan Borsodi

Tuesday 20 January 2004 6:36:35 am

Regarding the fatal error:
Try to turn off template compiling in site.ini, there is a bug in the compiling code that causes the new image template code to malfunction in some cases.

This could perhaps also be the source of the problem in the loop?

The fix will be out for 3.2-5, 3.3-3 and in trunk.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq