The ezkeyword datatype (Keywords)
Class eZKeywordType in kernel/classes/datatypes/ezkeyword/ezkeywordtype.php; identifier ezkeyword, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
What it stores
Its class names none of the standard columns; it stores its value elsewhere (a table of its own or another object). 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/ezkeyword.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
$attribute.content.keyword_string|wash( xhtml )
if is_set( $#persistent_variable.keywords )
set scope='global' persistent_variable=$#persistent_variable|merge( hash( 'keywords', concat( $#persistent_variable.keywords, ', ', $attribute.content.keyword_string ) ) )
else
if is_array( $#persistent_variable )|not()
set scope='global' persistent_variable=hash( 'keywords', $attribute.content.keyword_string )
else
set scope='global' persistent_variable=$#persistent_variable|merge( hash( 'keywords', $attribute.content.keyword_string ) )
/if
/ifThe shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezkeyword.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
default attribute_base=ContentObjectAttribute
<input id="ezcoa-if ne( $attribute_base, 'ContentObjectAttribute' )$attribute_base-/if$attribute.contentclassattribute_id_$attribute.contentclass_attribute_identifier" class="box ezcc-$attribute.object.content_class.identifier ezcca-$attribute.object.content_class.identifier_$attribute.contentclass_attribute_identifier" type="text" size="70" name="$attribute_base_ezkeyword_data_text_$attribute.id" value="$attribute.content.keyword_string|wash(xhtml)" />
/defaultOverride them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezkeyword.tpl and a match on attribute_identifier (see A template override).
Related
Generated by ./console exp:help:examples from kernel/classes/datatypes/ezkeyword/ezkeywordtype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezkeyword.tpl, design/standard/templates/content/datatype/edit/ezkeyword.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.