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.

eZ debug

Timing: Jan 18 2025 11:00:59
Script start
Timing: Jan 18 2025 11:00:59
Module start 'layout'
Timing: Jan 18 2025 11:00:59
Module start 'content'
Timing: Jan 18 2025 11:00:59
Module end 'content'
Timing: Jan 18 2025 11:00:59
Script end

Main resources:

Total runtime0.0170 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.0469152.6406
Module start 'layout' 0.00720.0029 740.687539.4766
Module start 'content' 0.01010.0053 780.164189.4922
Module end 'content' 0.01540.0016 869.656334.3047
Script end 0.0170  903.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.9591140.0002
Check MTime0.00116.5977140.0001
Mysql Total
Database connection0.00158.632010.0015
Mysqli_queries0.002716.034430.0009
Looping result0.00000.082710.0000
Template Total0.00137.410.0013
Template load0.00063.758710.0006
Template processing0.00063.639510.0006
Override
Cache load0.00042.540410.0004
General
dbfile0.00031.560480.0000
String conversion0.00000.046340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs