Share » Forums » Setup & design » How to show the relative objects in...

How to show the relative objects in template?

How to show the relative objects in template?

Saturday 21 March 2009 3:44:15 am - 2 replies

Author Message

justin kazadi

Monday 23 March 2009 1:00:58 am

Hi,
you don(t have access to the attribute

url_alias 

of an object relation so you have to use the main node.
so use this:

{foreach $node.data_map.relative_objects.content.relation_browse as $obj}


<a href={$obj.main_node.url_alias|ezurl}>{$obj.name|wash()}</a>


{/foreach}

i think this can help you.

good luck

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Quynh Nguyen

Monday 23 March 2009 1:11:55 pm

Hi Justin,

This is the attribute of each $obj

Attribute 	Type 	Value
identifier 	boolean 	false
priority 	string 	'9'
in_trash 	boolean 	false
contentobject_id 	string 	'892'
contentobject_version 	string 	'2'
node_id 	string 	'868'
parent_node_id 	string 	'124'
contentclass_id 	string 	'45'
contentclass_identifier 	string 	'news'
is_modified 	boolean 	false
contentobject_remote_id 	string 	'cf51ae7844a791ca07c2aaff667d73c9'

So I think there is no attribute main_node as you talked.

Because in ezpublish, we can link to eznode or ezobject. But it can be done in XML Block datatype (as when we compose content). The relatived objects are another datatype. I can use my method at the moment, but I'm looking for another better way.

Thanks you anyway!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu