ibexa

Path

ez publish / technical manual / 3.8 / reference / datatypes / object relations


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

Object relations

Summary

Stores relations to other content objects.

Properties

NameInternal nameSearchableInformation collector
Object relations ezobjectrelationlist Yes. No.

Description

This datatype allows the relation of multiple objects. The following screenshot shows the class attribute edit interface for this datatype.

Class attribute edit interface for the "Object relations" datatype.

Class attribute edit interface for the "Object relations" datatype.

Object attribute edit interface

The following screenshot shows the object attribute edit interface for this datatype.

Object attribute edit interface for the "Object relations" datatype.

Object attribute edit interface for the "Object relations" datatype.

 

Raw output

The ".content" of an ezcontentobjectattribute object using this datatype returns either FALSE (if there are no relations) or an array of ezcontentobjectattribute objects.

Balazs Halasy (21/02/2005 2:41 pm)

Balazs Halasy (06/05/2005 12:40 pm)


Comments

  • Use undocumented site.ini setting to make it work like it used to

    I just spent three hours trying to figure out why this function no longer allows you to upload new objects and edit existing ones after upgrading a large site for a client... Turns out it was changed on purpose and that there's an undocumented site.ini setting to make it work like it used to:

    [BackwardCompatibilitySettings]
    AdvancedObjectRelationList=enabled
  • INI-based limitations for browse selection method

    If you choose the selection method "browse", you can configure which browse type has to be used with an undocumented setting in content.ini:
    [ObjectRelationDataTypeSettings]
    ClassAttributeStartNode[]
    ClassAttributeStartNode[]=240;AddRelatedImageToDataType
    


    Where 240 is the class attribute id and AddRelatedImageToDataType is the browse type (this type can be configured in browse.ini).

    If for a specific class attribute no browse type has been specified, AddRelatedObjectListToDataType is used.

    The Object Relation datatype uses the same settings, but the default browse type is AddRelatedObjectToDataType.
  • minor typo

    The last paragraph should read:

    ...or an array of ezcontentobject objects.

    (The link target is correct.)
  • Example code to fill an attribute of this datatype with PHP

  • content access didn't word that way

    Tried accessing the ".content" of an ezcontentobjectattribute object in a design template, but it wasn't an array of ezcontentobjectattribute objects. Looking in other templates the best I figured out for now is that the following will allow me to iterate of the objects of an ezobjecrelationtlist:

    {foreach $myezattr.content.relation_list as $relation}
    {def $obj=fetch('content', 'object',
    hash('object_id', $relation.contentobject_id))}

    ...

    {undef $obj}
    {/foreach}

    Wondering if there's some fundamental thing I haven't understood here though...