Forums / Developer / Object relations datatype

Object relations datatype

Author Message

David Santiso

Friday 18 March 2011 2:20:36 pm

Hi,

I'm using object relations datatype into a object. I've created several objects reference other objects.

If I do this:

{attribute_view_gui attribute=$node.data_map.reference}

It shows a reference to the nother object, but I want to know which is the object identifier.

If I do this:

{set-block variable=$reference}
  {attribute_view_gui attribute=$node.data_map.category}
{/set-block}
...
{$reference.contentobject_id}

It displays the identifier of the object I am seeing.

How can I do?

Thanks,

David

Ivan Švogor

Saturday 19 March 2011 8:25:58 am

Hello,

If I understand correctly, you would like object identifier of the related class object. You can use relation_list attribute, like this:

$node.data_map.relation_kategorija.content.relation_list

And than you get array of IDs. With this, you can use a fetch function to fetch objects you want.

Hope this helps.

David Santiso

Saturday 19 March 2011 9:53:36 am

Yes, I want object identifier of the related class object.

I don't understand that you mean with:

"relation_kategorija"

Damien Pobel

Sunday 20 March 2011 4:39:03 am

Hi David,

relation_kategorija is the identifier of the attribute you defined in the content class. From your examples, it's reference or category.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

David Santiso

Sunday 20 March 2011 8:18:44 am

Ok. Thanks ;)