Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

ezenum datatype (Enum)

The ezenum datatype (Enum): what it stores and how templates use it.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/datatypes/ezenum.md

On this page

The ezenum datatype (Enum)

Class eZEnumType in kernel/classes/datatypes/ezenum/ezenumtype.php; identifier ezenum, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].

What it stores

The columns of the attribute tables its class reads or writes: data_int1, data_int2 (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/ezenum.tpl:

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{section var=Elements loop=$attribute.content.enumobject_list}
{$Elements.item.enumelement|wash( xhtml )}<br />
{/section}

The shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezenum.tpl (first 25 lines):

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default attribute_base=ContentObjectAttribute}
{switch match=$attribute.content.enum_ismultiple}
  {case match=1}
      {switch match=$attribute.content.enum_isoption}
        {case match=0}
          {section name=EnumList loop=$attribute.content.enum_list}
            <input type="hidden" name="{$attribute_base}_data_enumid_{$attribute.id}[]" value="{$EnumList:item.id}" />
            <input type="hidden" name="{$attribute_base}_data_enumvalue_{$attribute.id}[]" value="{$EnumList:item.enumvalue|wash}" />
        <input type="hidden" name="{$attribute_base}_data_enumelement_{$attribute.id}[]" value="{$EnumList:item.enumelement|wash}" />
    <p><label>
     <input id="ezcoa-{if ne( $attribute_base, 'ContentObjectAttribute' )}{$attribute_base}-{/if}{$attribute.contentclassattribute_id}_{$attribute.contentclass_attribute_identifier}_{$EnumList:index}" class="ezcc-{$attribute.object.content_class.identifier} ezcca-{$attribute.object.content_class.identifier}_{$attribute.contentclass_attribute_identifier}" type="checkbox" name="{$attribute_base}_select_data_enumelement_{$attribute.id}[]" value="{$EnumList:item.enumelement|wash}"
      {section name=EnumObjectList loop=$attribute.content.enumobject_list}
          {switch match=$EnumList:item.enumelement}
            {case match=$EnumList:EnumObjectList:item.enumelement}
           checked="checked"
            {/case}
        {case}{/case}
      {/switch}
      {/section}
        />&nbsp;{$EnumList:item.enumelement|wash}</label></p>
      {/section}
       {/case}
       {case match=1}
          {section name=EnumList loop=$attribute.content.enum_list}

Override them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezenum.tpl and a match on attribute_identifier (see A template override).


Generated by ./console exp:help:examples from kernel/classes/datatypes/ezenum/ezenumtype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezenum.tpl, design/standard/templates/content/datatype/edit/ezenum.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x