Link to the related object attribute.

Author Message

Salvatore Guarino

Wednesday 31 January 2007 8:07:25 am

Hi. I have a class with a related object attribute. Now I want to create, in the full template of this class, a link to open in his full template the related object, for example a video.

Something like this:


<a href="{$node.object.data_map.related_video.???|maybe_a_ezurl_function???}"

Any ideas?

Bye,

SG

André R.

Wednesday 31 January 2007 8:18:06 am

if it is object relation:

{if $node.data_map.related_video.has_content}
  <a href={$node.data_map.related_video.content.main_node.url_alias|ezurl}>{$node.data_map.related_video.content.name|wash}</a>

* node.data_map is shortcut for node.object.data_map
* unless you specify anything, ezurl will create the "" for you
* to find out things like this yourself, you could use {$node.object.data_map.related_video.content|attribute('show', 1)}, where 1 is the number of sub levels you want to print out.
* the content of $node.data_map.related_video.content is the object that is related and not the node, that's why I use main_node to get the main_node the object belongs to

If it is object relations:

{if $node.data_map.related_video.has_content}
  {foreach $node.data_map.related_video.content.relation_list as $element}
    <a href={$element.main_node.url_alias|ezurl}>{$element.name|wash}</a>

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Salvatore Guarino

Wednesday 31 January 2007 11:27:38 pm

Thank you very much!

Bye,

Salvatore

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 15:55:53
Script start
Timing: Jan 18 2025 15:55:53
Module start 'layout'
Timing: Jan 18 2025 15:55:53
Module start 'content'
Timing: Jan 18 2025 15:55:54
Module end 'content'
Timing: Jan 18 2025 15:55:54
Script end

Main resources:

Total runtime0.6209 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.0071 589.0078153.4531
Module start 'layout' 0.00710.0036 742.460939.3906
Module start 'content' 0.01070.6090 781.8516547.6484
Module end 'content' 0.61970.0012 1,329.500012.4688
Script end 0.6209  1,341.9688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5244160.0002
Check MTime0.00130.2095160.0001
Mysql Total
Database connection0.00100.154610.0010
Mysqli_queries0.572392.1789570.0100
Looping result0.00050.0862550.0000
Template Total0.592795.520.2964
Template load0.00180.284620.0009
Template processing0.590995.175020.2955
Template load and register function0.00010.015110.0001
states
state_id_array0.00060.100110.0006
state_identifier_array0.00060.104220.0003
Override
Cache load0.00140.2329250.0001
Sytem overhead
Fetch class attribute can translate value0.00050.088120.0003
Fetch class attribute name0.00090.137850.0002
XML
Image XML parsing0.00110.171020.0005
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00130.2132240.0001
String conversion0.00000.001540.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/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/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.0002 secs