Question on Object Relation

Author Message

Oliver Weich

Wednesday 26 November 2003 6:47:58 am

Hi Folks,

I've got a little problem with the ObjectRelation Datatype: How do I access the related Object within a template?

I tried the following approach:

{content_view_gui view=line
content_object=fetch(content,object,
hash(object_id, $node.object.data_map.featured_production_item.content.contentobject_id))}

where 'featured_production_item' is the field, which stores the object relation.

I get no output from this. Also I don't know any help, cause documentation on this topic seems to be very rare.

Any sugestions?

Any help would be greatly appreciated!

Cheers

Oliver

EDIT: My Version is 3.2-1 :)

Claus Jensen

Wednesday 26 November 2003 7:06:24 am

Hi Oliver,
If you look in the standard/content/view/full.tpl you see an example of this. Check:

<h2>{"Related objects"|i18n("design/standard/content/view")}</h2>

<table class="list" width="100%" cellspacing="0" cellpadding="0" border="0">
{section name=Object loop=$related_contentobject_array show=$related_contentobject_array sequence=array(bglight,bgdark)}
<tr>
<td class="{$Object:sequence}">
{content_view_gui view=text_linked content_object=$Object:item}
</td>
</tr>
{/section}

regards,
claÜs

Paul Borgermans

Wednesday 26 November 2003 7:10:32 am

This is what I currently use in several templates for full view of classes with keywords:

{let related=$node.object.data_map.keywords.content.related_objects}
{section show=$related}
<h3>Related documents containing one or more of the same keywords</h3>
<ol>
{section name=Related loop=$related}
<li><a href={$:item.url_alias|ezurl}>{$:item.name}</a></li>
{/section}
</ol>
{/section}
{/let}

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Oliver Weich

Friday 28 November 2003 3:27:27 am

Thanks! Your help was very useful!

In fact I found a workaround for my Problem by using the embed viewmode. :)

Regards

Oliver

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

Main resources:

Total runtime0.0159 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 590.2891152.6250
Module start 'layout' 0.00580.0034 742.914139.4453
Module start 'content' 0.00920.0047 782.359493.3203
Module end 'content' 0.01380.0020 875.679734.3047
Script end 0.0159  909.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.0998140.0002
Check MTime0.00127.7076140.0001
Mysql Total
Database connection0.00095.628710.0009
Mysqli_queries0.002716.848630.0009
Looping result0.00000.163310.0000
Template Total0.001610.210.0016
Template load0.00095.799410.0009
Template processing0.00074.385510.0007
Override
Cache load0.00063.913710.0006
General
dbfile0.00031.939680.0000
String conversion0.00000.119840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs