Getting urls for related objects...

Author Message

Ben Pirt

Wednesday 30 July 2003 3:46:59 am

Hi all,
I have a number of related objects to a node which I want to provide links to using the ezroot/nice urls method, but I can't seem to access the url_alias variable for these objects. I have the following code:

{section name=Related loop=$node.object.related_contentobject_array}
<a href="{$Related:item.url_alias|ezroot}">{$Related:item.name}</a>
{/section}

which shows the name of the objects fine, but I can't get the correct url to display properly. I'm sure I'm missing something completely obvious here, but I feel like i'm banging my head against a brick wall at the moment. Any help would be massively appreciated.

All the best,

Ben Pirt

Bjørn Kaarstein

Wednesday 30 July 2003 3:52:19 am

Maybe it's possible to check {$Related:item|attribute(show)} to check what you have access to...

Regards Bjørn

Ben Pirt

Wednesday 30 July 2003 4:32:05 am

Thanks Bjørn,
that was exactly what I was looking for. Makes it much easier to work things out for yourself with that.
Cheers,
Ben

PS for those interested the correct access was:

{section name=Related loop=$node.object.related_contentobject_array}
<a href={concat("/",$Related:item.main_node.url_alias)|ezroot}>{$Related:item.name}</a>
{/section}

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 19:29:05
Script start
Timing: Jan 18 2025 19:29:05
Module start 'layout'
Timing: Jan 18 2025 19:29:05
Module start 'content'
Timing: Jan 18 2025 19:29:06
Module end 'content'
Timing: Jan 18 2025 19:29:06
Script end

Main resources:

Total runtime0.7897 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.8359152.6250
Module start 'layout' 0.00580.0038 742.460939.4453
Module start 'content' 0.00960.7784 781.9063470.1016
Module end 'content' 0.78810.0016 1,252.00788.1563
Script end 0.7896  1,260.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4480160.0002
Check MTime0.00130.1679160.0001
Mysql Total
Database connection0.00090.117510.0009
Mysqli_queries0.740093.7140570.0130
Looping result0.00060.0699550.0000
Template Total0.749894.920.3749
Template load0.00230.285620.0011
Template processing0.747594.659920.3738
Template load and register function0.00030.036710.0003
states
state_id_array0.00090.116610.0009
state_identifier_array0.00120.149720.0006
Override
Cache load0.00190.2358230.0001
Sytem overhead
Fetch class attribute can translate value0.00070.084920.0003
Fetch class attribute name0.00110.140830.0004
XML
Image XML parsing0.00020.030520.0001
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00090.1168100.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs