Object relations
Summary
Stores relations to other content objects.
Properties
| Name | Internal name | Searchable | Information 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.
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.
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.
Contributors
- Balazs Halasy Updated
- Daniel Staver Commenter
- Kristof Coomans Commenter
- Matthew Carroll Commenter
- Dag Sverre Seljebotn Commenter
Comments (6 historical)
Written by readers of the earlier documentation sites, kept as they were.
Use undocumented site.ini setting to make it work like it used to
Daniel Staver ·
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
Kristof Coomans ·
If you choose the selection method "browse", you can configure which browse type has to be used with an undocumented setting in content.ini:
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.
Re: INI-based limitations for browse selection method
Kristof Coomans ·
See also: http://ez.no/community/forum/gene...objects_at_once_for_object_relations
minor typo
Matthew Carroll ·
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
Kristof Coomans ·
See http://ez.no/community/forum/deve...n_attribute_type_within_a_php_script
content access didn't word that way
Dag Sverre Seljebotn ·
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...