How to list the related objects to article ?

Author Message

Selmah Maxim

Monday 13 June 2005 8:23:56 am

Hi all ..

Again same problem ... I have an article and there is "object relation" data type in the article class, how to list this objects ?!

thanks in advance.

François Xavier Lacroix

Tuesday 14 June 2005 2:01:20 am

Hi,
I think you can try this :

{let my=fetch(content, node, hash(node_id, xxx))}
{section loop=$my.object.related_contentobject_array}
{$:item.name}
{/section}
{/let}

It works fine for me : i found the related item in this loop.

regards.

Selmah Maxim

Tuesday 14 June 2005 3:19:12 pm

thanks ... but its show my nothing :(

but with this code its counting 1 object :

{let $objects_count=fetch( content, reverse_related_objects_count, hash( object_id, $node.contentobject_id, attribute_identifier, 219 ) )}
~[{$objects_count}]~<br>
{/let}

:(

Paul d

Wednesday 20 July 2005 12:28:30 pm

Hi Maxim

I take your code and change it, now its works ;)

{def $objects=fetch( 'content', 'reverse_related_objects', hash( object_id, $node.contentobject_id, attribute_identifier, 219 ) )}

{foreach $objects as $obj}
		{$obj.name|wash} <br /> 
{/foreach}

Regards,
PDN

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 21:07:05
Script start
Timing: Jan 18 2025 21:07:05
Module start 'layout'
Timing: Jan 18 2025 21:07:05
Module start 'content'
Timing: Jan 18 2025 21:07:06
Module end 'content'
Timing: Jan 18 2025 21:07:06
Script end

Main resources:

Total runtime1.1115 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.0469152.6406
Module start 'layout' 0.00750.0037 740.687539.4766
Module start 'content' 0.01121.0985 780.1641554.3438
Module end 'content' 1.10970.0018 1,334.507812.1250
Script end 1.1115  1,346.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.3292160.0002
Check MTime0.00160.1454160.0001
Mysql Total
Database connection0.00170.152910.0017
Mysqli_queries1.056795.0686620.0170
Looping result0.00060.0556600.0000
Template Total1.073996.620.5369
Template load0.00240.218320.0012
Template processing1.071496.394720.5357
Template load and register function0.00010.011810.0001
states
state_id_array0.00110.101410.0011
state_identifier_array0.00160.141120.0008
Override
Cache load0.00200.1801290.0001
Sytem overhead
Fetch class attribute can translate value0.00050.041730.0002
Fetch class attribute name0.00090.078460.0001
XML
Image XML parsing0.00250.227630.0008
class_abstraction
Instantiating content class attribute0.00000.001060.0000
General
dbfile0.00260.2362220.0001
String conversion0.00000.000840.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
4content/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
2content/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
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs