Forums / Setup & design / url single related object

url single related object

Author Message

Robert Malevic

Thursday 22 May 2008 2:44:10 pm

As a newbe I just started with related objects. I added some object relation attributes (single relation) to a content class. Trying to fetch different atrributes works in this code:

 

{if $node.data_map.item_4.has_content}
     <h4><a href="WHAT TO INSERT TO GET THE URL OF THE RELATED OBJECT?">
     <strong>{attribute_view_gui 
                   attribute=$node.object.data_map.item_4.content.data_map.title}
    </strong>
     <span>{attribute_view_gui 
                 attribute=$node.object.data_map.item_4.content.data_map.sub_title}
     </span></a></h4>
							
    <p>
        {attribute_view_gui
                attribute=$node.object.data_map.item_4.content.data_map.intro}
    </p>
{/if}  
 

Somehow I am not able to fetch the url of the related object. What do I need to insert to get the url?

Thanks for helping!

Gurudutt Verma

Thursday 22 May 2008 11:30:27 pm

Hi Robert,

Welcome to eZ World :-)

Try to have a look in this template
design/standard/templates/content/datatype/view/ezobjectrelation.tpl

OR Try
{$node.object.data_map.item_4.content|attribute(show)}

This should give you url of related object.
{$node.object.data_map.item_4.content.main_node.url_alias}

Robert Malevic

Friday 23 May 2008 11:57:55 am

Hi Gurudutt,

{$node.object.data_map.item_4.content.main_node.url_alias} was the solution.

Thanks for your support!