Stéphane Bullier
|
Thursday 07 June 2007 10:02:35 am
Hello, I have a object with several related object. I try to fetch them to use the parmeter 'attribute_identifier'.
{def $objects=fetch( 'content', 'related_objects',
hash( 'object_id', $node.contentobject_id,
'attribute_identifier', 309 ) )}
{foreach $objects as $object}
{$object.name|wash} <br />
{/foreach}
But the querry return nothing. When I don't use the parameter it's work fine. Any idea !!
Stéphane
|
Paul Leclercq
|
Friday 08 June 2007 8:22:11 am
You should add the "all_relations" parameter. You can also try using the "class/identifier" insted of the ID of your related object's attribute:
{def $objects=fetch( 'content', 'reverse_related_objects',
hash(
'object_id', $node.contentobject_id,
'all_relations',false(),
'attribute_identifier', 'class/attribute'
) )}
|
Stéphane Bullier
|
Friday 08 June 2007 9:22:02 am
Hello Paul, Thank for you reply. But It's not working. I try to use :
{def $tableau_partenaire=fetch( 'content', 'related_objects',
hash( 'object_id', $node.object.id,
'all_relations', attribute,
'attribute_identifier', '376' ) )}
without success. Help !!
Stéphane
|
Maurizio Betti
|
Friday 22 June 2007 5:27:52 am
I find the same problem on 3.9.2 using reverse_related_objects:
{def $objects=fetch( 'content', 'reverse_related_objects', hash( 'object_id', $node.contentobject_id, 'all_relations', true ) )}
the $objects array results be void. On the other side I'm sure reverse related object exist 'cause I can see them from Admin interface. Any idea to solve it? Best regards
Maurizio Betti
http://www.arsweb.it
http://www.hospes.it
|
John Kazakis
|
Monday 16 June 2008 8:39:17 am
Hello, I've tried to use reverse_related_objects, to fetch a list of articles for the current author, This is the code that I'm currently using, now the problem with this is that if the article written by an author has different locations, all locations are shown, so I have the same article showing 3 or 4 times in the same page. Is there something like 'main_node_only' for reverse_related_objects, or do I have to install an extension or a template plugin? Below is the code that I am using,
{if $node.node_id|eq($node.node_id)}
{def $objects=fetch( 'content', 'reverse_related_objects',
hash( 'object_id', $node.contentobject_id,
'all_relations', true(),
'group_by_attribute', false(),
'ignore_visibility', false(),
'sort_by', array('published', false()) ))}
{foreach $objects as $object}
<a href={$object.main_node.url_alias|ezurl()}>{attribute_view_gui attribute=$object.data_map.full_name}</a>
{/foreach}
{/if}
Thanks, John.
|