Related Object URL

Author Message

David Jones

Monday 21 August 2006 6:49:05 am

I want to create a link to a related object.

This is my code

{let related_objects=fetch( 'content', 'related_objects',
	hash( 'object_id', $module_result.content_info.object_id ) )}
				   
	      {section loop=$related_objects var=related_object}
				  		
		    {if eq($related_object.content_class.identifier, "text_page" )}
			<a href={$related_object.url_alias|ezurl()}>{$related_object.data_map.page_title.content|wash}</a><br />
		     {/if}
		{/section}

The link displays with the correct page title but the URL is incomplete. It simply links to the rout of the site..

I assume that this

$related_object.url_alias|ezurl()

Doesn't pull out the objects URL.

What does?

Thanks

Damien Pobel

Monday 21 August 2006 7:18:27 am

$related_object is an ezcontentobject [1], to get his URL you need an ezcontentobjecttreenode [2]. It should work with :

$related_object.main_node.url_alias|ezurl()

[1] http://ez.no/doc/ez_publish/technical_manual/3_8/reference/objects/ezcontentobject
[2] http://ez.no/doc/ez_publish/technical_manual/3_8/reference/objects/ezcontentobjecttreenode

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

David Jones

Monday 21 August 2006 8:09:30 am

thanks, that worked great.

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

Main resources:

Total runtime0.7923 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.0068 588.9141152.6094
Module start 'layout' 0.00680.0031 741.523439.4297
Module start 'content' 0.01000.7804 780.9531535.1563
Module end 'content' 0.79030.0019 1,316.109412.1875
Script end 0.7922  1,328.2969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.5756160.0003
Check MTime0.00180.2253160.0001
Mysql Total
Database connection0.00110.141510.0011
Mysqli_queries0.730492.1923570.0128
Looping result0.00070.0924550.0000
Template Total0.758395.720.3792
Template load0.00260.330420.0013
Template processing0.755795.382420.3778
Template load and register function0.00020.027510.0002
states
state_id_array0.00090.113310.0009
state_identifier_array0.00110.143520.0006
Override
Cache load0.00230.2870200.0001
Sytem overhead
Fetch class attribute can translate value0.00090.116020.0005
Fetch class attribute name0.00150.192140.0004
XML
Image XML parsing0.00280.358220.0014
class_abstraction
Instantiating content class attribute0.00000.001840.0000
General
dbfile0.00280.3540160.0002
String conversion0.00000.001140.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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs