Forums / Setup & design / Object relations (datatype) does it work?

Object relations (datatype) does it work?

Author Message

Atle Enersen

Tuesday 08 April 2003 11:18:43 pm

I created two classes, both with a datatype "Object relation". First I related object "B" into object "A", tried all examples found in the tpl's (both for related and child items) without any luck. Then I related object "A" into object "B" and tried the same all over again (viewing both objects) keeping the first relationship. No luck.

No, there is no caching at the site, and paranoid as I am I cleared the cache manually to be sure.

Of corse it is possible I did not use the correct code-snipplet(s), but... So the question remains, are object relations working or am I doing something wrong?

...and if it is working, it would be nice with at code-snipplet that eZ-crew knows in fact are working :-)

It's eZ3 final on Apache 2.*/Linux btw.

\\atle\\
--

Bård Farstad

Friday 11 April 2003 6:55:13 am

Object relations does work in 3.0. You can see it in action here at ez.no. The "last forum messages", banners and "latest news" are all embeded related objects.

If you take a look at the standard templates, full.tpl, you will see that there is a block for the related objects. This block will show all objects which is related to the current object.

--bård

Documentation: http://ez.no/doc

Atle Enersen

Monday 14 April 2003 2:23:35 am

Well, I actually did that, and I did it again just to ensure that I did'nt do any mistakes. It still is'nt working. This is (one of the) code(s) used...:

{default content_version=$node.contentobject_version_object
node_name=$node.name}
....

{section name=Object loop=$content_version.related_contentobject_array show=$content_version.related_contentobject_array}
<div class="block">
{content_view_gui view=text_linked content_version=$Object:item}
</div>
{/section}

\atle\
--

Bård Farstad

Monday 14 April 2003 2:40:57 am

Try this:

{section name=Related loop=$node.object.related_contentobject_array}
{$Related:item.name}
{/section}

It should work, if you put it in your override for full.tpl. I just tested it with my installation. I used it in full_class_1.tpl.

--bård

Documentation: http://ez.no/doc