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.