Multiple related objects

Author Message

Dev Trimaran

Tuesday 09 June 2009 7:50:05 am

Hi ,
I have use the field related objects to rely a object to multiples objects.
Then I try to fecth all the related object.
So I use the fecth function with 'related_objects' like this :
{def $links = fetch( 'content', 'reverse_related_objects', hash( 'object_id', $keyword.node_id ))}
{def $links2 = fetch( 'content', 'related_objects', hash( 'object_id', $keyword.node_id ))}

I tryed related and reverse_related ....

But it did not work.
Is it because its' a multiples related object ?

Plus , I can see in the back office the related objects , so I guess there is a way to do it....

Thanks for your help ...

André R.

Tuesday 09 June 2009 8:48:48 am

You'll need to use the object id of the keyword node, not the node id.
It's most likely $keyword.contentobject_id you'll want to use.

Node vs object reference:
http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_management/the_content_node
http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_management/the_content_node_tree

Node attributes:
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/objects/ezcontentobjecttreenode

I guess you have looked at it, but place a link to the related_objects fetch doc page here anyway:
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/related_objects

And while on it, the different type of relations in ezp:
http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_management/object_relations

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

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 16:20:26
Script start
Timing: Jan 18 2025 16:20:26
Module start 'layout'
Timing: Jan 18 2025 16:20:26
Module start 'content'
Timing: Jan 18 2025 16:20:27
Module end 'content'
Timing: Jan 18 2025 16:20:27
Script end

Main resources:

Total runtime0.7327 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.3438152.6250
Module start 'layout' 0.00470.0023 741.968839.4453
Module start 'content' 0.00700.7240 781.4141532.1250
Module end 'content' 0.73100.0016 1,313.53918.1641
Script end 0.7327  1,321.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4442160.0002
Check MTime0.00130.1718160.0001
Mysql Total
Database connection0.00060.084910.0006
Mysqli_queries0.686193.6448540.0127
Looping result0.00060.0758520.0000
Template Total0.705496.320.3527
Template load0.00220.294520.0011
Template processing0.703295.972220.3516
Template load and register function0.00020.021410.0002
states
state_id_array0.00070.092110.0007
state_identifier_array0.00070.102120.0004
Override
Cache load0.00180.2455270.0001
Sytem overhead
Fetch class attribute can translate value0.00060.088320.0003
Fetch class attribute name0.00160.220130.0005
XML
Image XML parsing0.00070.094720.0003
class_abstraction
Instantiating content class attribute0.00000.001830.0000
General
dbfile0.00080.1092170.0000
String conversion0.00000.000940.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs