The ezobjectrelationlist datatype (Object relations)
Class eZObjectRelationListType in kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php; identifier ezobjectrelationlist, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
What it stores
The columns of the attribute tables its class reads or writes: 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.
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/ezobjectrelationlist.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{def $check_visibility = ezini( 'SiteAccessSettings', 'ShowHiddenNodes' )|ne( 'true' )
$content = false()
$has_readable_related = false()}
section var=Relations loop=$attribute.content.relation_list
if $Relations.item.in_trash|not()
set $content = fetch( content, object, hash( object_id, $Relations.item.contentobject_id ) )
if or( $content.can_read, $content.can_view_embed)
{if or(
$check_visibility|not,
fetch( content, node, hash( node_id, $Relations.item.node_id ) ).is_invisible|not
)}
content_view_gui view=embed content_object=$content<br>
set $has_readable_related = true()
/if
/if
/if
/section
if $has_readable_related|not()
'There are no related objects.'|i18n( 'design/standard/content/datatype' )
/if
undef $check_visibility $content $has_readable_relatedThe shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezobjectrelationlist.tpl (first 25 lines):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{let class_content=$attribute.class_content
class_list=fetch( class, list, hash( class_filter, $class_content.class_constraint_list ) )
can_create=true()
new_object_initial_node_placement=false()
browse_object_start_node=false()}
if $class_content.selection_type|ne( 0 ) {* If current selection mode is not 'browse'. *}
default attribute_base=ContentObjectAttribute
{let parent_node=cond( and( is_set( $class_content.default_placement.node_id ),
$class_content.default_placement.node_id|eq( 0 )|not ),
$class_content.default_placement.node_id, 1 )
nodesList=cond( and( is_set( $class_content.class_constraint_list ), $class_content.class_constraint_list|count|ne( 0 ) ),
fetch( content, tree,
hash( parent_node_id, $parent_node,
class_filter_type,'include',
class_filter_array, $class_content.class_constraint_list,
sort_by, array( 'name',true() ),
main_node_only, true() ) ),
fetch( content, list,
hash( parent_node_id, $parent_node,
sort_by, array( 'name', true() )
) )
)
}Override them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezobjectrelationlist.tpl and a match on attribute_identifier (see A template override).
Related
Generated by ./console exp:help:examples from kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezobjectrelationlist.tpl, design/standard/templates/content/datatype/edit/ezobjectrelationlist.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.