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

Datentyp ezselection (Auswahlliste)

Der Datentyp ezselection (Auswahlliste): was er speichert und wie Templates ihn verwenden.

Download as PDF

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

On this page

This page is a translation. Read the English original

Der Datentyp ezselection (Auswahlliste)

Klasse eZSelectionType in kernel/classes/datatypes/ezselection/ezselectiontype.php; Bezeichner ezselection, aufgeführt in settings/content.ini [DataTypeSettings] AvailableDataTypes[].

Was er speichert

Die Spalten der Attributtabellen, die seine Klasse liest oder schreibt: data_int1, data_text, data_text5 (data_text, data_int, data_float und sort_key_* gehören zum Objektattribut; data_text1 ... data_int4 sind die Einstellungen des Klassenattributs). Durch Lesen der Klasse ermittelt: eine Heuristik. Sortierung: sortKeyType() gibt string zurück. Er ist von der Suche indiziert; ein Informationssammler (Formulare).

In Templates

my_attribute steht für den Bezeichner eines Attributs dieses Typs in Ihrer Klasse:

{def $attribute = $node.data_map.my_attribute}
{if $attribute.has_content}
    {attribute_view_gui attribute=$attribute}
{/if}
{* der Wert, wie der Datentyp ihn zurückgibt (objectAttributeContent()) *}
{$attribute.content|attribute( show, 1 )}

Das ausgelieferte Template, das ihn anzeigt (attribute_view_gui), design/standard/templates/content/datatype/view/ezselection.tpl:

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{* The selected options in the order of the class, one per line: a <br /> only between two of them, nothing
   before, after or around a single one (portions derived from LoveStack, mugoweb/ezpublish-legacy, commits
   eee7f69fc3 and 67eec8f972, Copyright (C) Mugo Web, GPL v2). *}
{def $selected_id_array = $attribute.content
     $selection_shown = false()}
{foreach $attribute.class_content.options as $option}{if $selected_id_array|contains( $option.id )}{if $selection_shown}<br />{/if}{$option.name|wash( xhtml )}{set $selection_shown = true()}{/if}{/foreach}
{undef $selected_id_array $selection_shown}

Das ausgelieferte Template, das ihn bearbeitet (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezselection.tpl:

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default attribute_base=ContentObjectAttribute}
{let selected_id_array=$attribute.content}

{* Always set the .._selected_array_.. variable, this circumvents the problem when nothing is selected. *} 
<input type="hidden" name="{$attribute_base}_ezselect_selected_array_{$attribute.id}" value="" />

<select id="ezcoa-{if ne( $attribute_base, 'ContentObjectAttribute' )}{$attribute_base}-{/if}{$attribute.contentclassattribute_id}_{$attribute.contentclass_attribute_identifier}" class="ezcc-{$attribute.object.content_class.identifier} ezcca-{$attribute.object.content_class.identifier}_{$attribute.contentclass_attribute_identifier}" name="{$attribute_base}_ezselect_selected_array_{$attribute.id}[]" {if $attribute.class_content.is_multiselect}multiple{/if}>
{section var=Options loop=$attribute.class_content.options}
<option value="{$Options.item.id|wash}" {if $selected_id_array|contains( $Options.item.id )}selected="selected"{/if}>{$Options.item.name|wash( xhtml )}</option>
{/section}
</select>
{/let}
{/default}

Überschreiben Sie sie für ein Klassenattribut in einer override.ini.append.php mit Source=content/datatype/view/ezselection.tpl und einer Bedingung auf attribute_identifier (siehe Ein Template-Override).

Siehe auch


Erzeugt von ./console exp:help:examples --language=ger-de aus kernel/classes/datatypes/ezselection/ezselectiontype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezselection.tpl, design/standard/templates/content/datatype/edit/ezselection.tpl. Bearbeiten Sie diese Seite nicht: Ändern Sie die Quelle oder die deutsche Übersetzung und erzeugen Sie sie neu (wie). Freie Dokumentation: GFDL 1.3 oder später.

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