The ezobjectrelation datatype (Object relation)
Class eZObjectRelationType in kernel/classes/datatypes/ezobjectrelation/ezobjectrelationtype.php; identifier ezobjectrelation, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
What it stores
The columns of the attribute tables its class reads or writes: data_int, data_int1, data_int2, data_int3, data_text, data_text5 (data_text, data_int, data_float and sort_key_* are the object attribute's; data_text1 ... data_int4 the class attribute's settings). Found by reading the class: a heuristic.
Sorting: sortKeyType() returns int.
It is indexed by the search.
In templates
my_attribute stands for the identifier of an attribute of this type in your class:
def $attribute = $node.data_map.my_attribute
if $attribute.has_content
attribute_view_gui attribute=$attribute
/if
{* the value as the datatype returns it (objectAttributeContent()) *}
$attribute.content|attribute( show, 1 )The shipped template that shows it (attribute_view_gui), design/standard/templates/content/datatype/view/ezobjectrelation.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
if and( $attribute.content, or( $attribute.content.can_read, $attribute.content.can_view_embed ), $attribute.content.has_visible_node )
content_view_gui view=text_linked content_object=$attribute.content
else
'No relation'|i18n( 'design/standard/content/datatype' )
/ifThe shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezobjectrelation.tpl (first 25 lines):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
default attribute_base=ContentObjectAttribute
let class_content=$attribute.contentclass_attribute.content
switch match=$class_content.selection_type
{* Browse. *}
case match=0
<div class="block" id="ezobjectrelation_browse_$attribute.id">
<table class="listif $attribute.content|not hide/if" cellspacing="0">
<thead>
<tr>
<th>'Name'|i18n( 'design/standard/content/datatype' )</th>
<th>'Type'|i18n( 'design/standard/content/datatype' )</th>
<th>'Section'|i18n( 'design/standard/content/datatype' )</th>
<th>'Published'|i18n( 'design/standard/content/datatype' )</th>
</tr>
</thead>
<tbody>
<tr class="bglight">
if and( $attribute.content, or( $attribute.content.can_read, $attribute.content.can_view_embed ) )
{* Name *}
<td>$attribute.content.name|wash()</td>Override them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezobjectrelation.tpl and a match on attribute_identifier (see A template override).
Related
Generated by ./console exp:help:examples from kernel/classes/datatypes/ezobjectrelation/ezobjectrelationtype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezobjectrelation.tpl, design/standard/templates/content/datatype/edit/ezobjectrelation.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.