Fetching ezurl object attributes (is_valid) by ID

Author Message

Mauro Innocenti

Tuesday 05 July 2005 5:04:04 am

I added a ezurl attribute to my own class (ezp 3.6.0).

In the custom template I'm writing for viewing the objects of that class I want to check if the link corresponding to the ezurl attribute is valid or not before displaying it.
But the template language document only a "list" fetch for ezurl objects and nothing for fetching ezurls "by ID" (I want to check the "is_valid" attribute of the ezurl object identified by the ID retrieved from my own class attribute).

Actually I retrieve my own ezurl class attribute (in template) with this code ("siteurl" is the attribute identifier):

$node.object.data_map.siteurl

But with this code contain only some of the ezurl attributes (e.g. the ezurl ID, but not the "is_valid" I want to check).

I had to write my own template operator?

Thanks,
Mauro

Massimiliano Bariola

Tuesday 05 July 2005 7:33:06 am

Hi,

I am not sure about what you mean; maybe the problem is because you're referring to an ID from a *class* attribute, instead of an ID of an ezurl within a real *object*?

maybe try writing a test fetch for the ezurl of a real, test object, then do a $fetchresult|attribute(show)

Apologies if I misunderstood you

Mauro Innocenti

Tuesday 05 July 2005 8:56:21 am

Hi Max (I like to write You in italian...),

none of the attributes in the output of

$node.object.data_map.siteurl

seem's to refer to the "is_valid" ezurl object attribute, so I think the only way is "fetching" the ezurl object, but there is not fetch function to do this by ID (only the "list")...

Now?

Mauro Innocenti

Tuesday 05 July 2005 8:57:32 am

I'm sorry, in my previous reply the correct code is:

$node.object.data_map.siteurl|attribute(show)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.