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!

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:01:42
Script start
Timing: Jan 18 2025 11:01:42
Module start 'layout'
Timing: Jan 18 2025 11:01:42
Module start 'content'
Timing: Jan 18 2025 11:01:43
Module end 'content'
Timing: Jan 18 2025 11:01:43
Script end

Main resources:

Total runtime1.0438 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.0046 589.3438152.6250
Module start 'layout' 0.00460.0021 741.968839.4453
Module start 'content' 0.00671.0356 781.4141505.2813
Module end 'content' 1.04240.0014 1,286.695312.4766
Script end 1.0437  1,299.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3026160.0002
Check MTime0.00120.1133160.0001
Mysql Total
Database connection0.00060.059310.0006
Mysqli_queries0.996095.4270570.0175
Looping result0.00060.0564550.0000
Template Total1.009396.720.5047
Template load0.00190.182620.0010
Template processing1.007496.515720.5037
Template load and register function0.00020.021610.0002
states
state_id_array0.00120.111710.0012
state_identifier_array0.00130.124720.0007
Override
Cache load0.00160.1531220.0001
Sytem overhead
Fetch class attribute can translate value0.00120.115520.0006
Fetch class attribute name0.00110.106740.0003
XML
Image XML parsing0.00210.205220.0011
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00220.2076160.0001
String conversion0.00000.000640.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
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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
3content/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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs