How to list a object relation list

How to list a object relation list

Monday 02 May 2005 12:36:46 am - 4 replies

Modified on Monday 02 May 2005 12:47:17 am by Werner Klausen

Author Message

Felix Laate

Monday 02 May 2005 12:59:29 am

Hi Werner!

I've done this with:

{*related is object relation list*}
{attribute_view_gui attribute=$node.object.data_map.related}

(in the full override for the class in question)

If you want to do a manual loop, you could perhaps do this:

{section name=myLoop loop=$node.object.data_map.related}
<li>$myLoop:item.blablabla</li>
{/section}

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Werner Klausen

Monday 02 May 2005 1:19:05 am

Thanks for the reply Felix!

I probably should have stated that I'm very new to eZ, but I understood that I needed more code than that. :)

This is now what I got semi working:

<ul>
{let attribute=fetch( 'content', 'node', hash( 'node_id', 102 ))}
{*elementer is object relation list*}
{attribute_view_gui attribute=$attribute.object.data_map.elementer}
{/let}
</ul>

For some reston I had to change <i>node</i> to <i>attribute </i> in $node.object.data_map.elementer to get it to list anything. However, I did not get the loop to work. And in addition it's listing out all the childnodes that each object-relation got.

eZ template language is very confusing atm :)

Because I can!

Werner Klausen

Monday 02 May 2005 3:37:56 am

Ok, now I got it to list one and one item of the object relation list, just thought I'd show how in case others might find it useful:

<ul>
{let menu=fetch( 'content', 'node', hash( 'node_id', 102 )) }
{section var=Relations loop=$menu.object.data_map.elementer.content.relation_list}
<li>
{content_view_gui view=text content_object=fetch( content, object,
hash( object_id, $Relations.item.contentobject_id ))}
</li>
{/section}
{/let}
</ul>

Now all I need is to make links of these somehow so that they link to the actual object that they are :)

Because I can!

Werner Klausen

Monday 02 May 2005 3:49:32 am

view=text_linked

:) I Suppose this thread is now ended for my part.

Because I can!

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.