Der Datentyp ezoption (Option)
Klasse eZOptionType in kernel/classes/datatypes/ezoption/ezoptiontype.php; Bezeichner ezoption, aufgeführt in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
Was er speichert
Die Spalten der Attributtabellen, die seine Klasse liest oder schreibt: data_int, data_text, data_text1 (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.
Er ist 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/ezoption.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
<label>$attribute.content.name|wash( xhtml ):</label>
section show=$attribute.content.option_list
<select name="eZOption[$attribute.id]">
section var=Options loop=$attribute.content.option_list
if ne( $Options.item.additional_price, '' )
<option value="$Options.item.id">$Options.item.value|wash() - $Options.item.additional_price|l10n( currency )</option>
else
<option value="$Options.item.id">$Options.item.value|wash()</option>
/if
/section
</select>
section-else
<p>'There are no options.'|i18n( 'design/standard/content/datatype' )</p>
/sectionDas ausgelieferte Template, das ihn bearbeitet (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezoption.tpl (die ersten 25 Zeilen):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
default attribute_base=ContentObjectAttribute
<div class="block">
<label for="ezcoa-if ne( $attribute_base, 'ContentObjectAttribute' )$attribute_base-/if$attribute.contentclassattribute_id_$attribute.contentclass_attribute_identifier">'Name'|i18n( 'design/standard/content/datatype' ):</label>
<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" name="$attribute_base_data_option_name_$attribute.id" value="$attribute.content.name|wash()" />
</div>
<div class="block">
<label>'Options'|i18n( 'design/standard/content/datatype' ):</label>
section show=$attribute.content.option_list
<table class="list" cellspacing="0">
<tr>
<th class="tight"> </th>
<th>'Option'|i18n( 'design/standard/content/datatype' )</th>
if $attribute.is_information_collector|not
<th>'Additional price'|i18n( 'design/standard/content/datatype' )</th>
/if
</tr>
section var=Options loop=$attribute.content.option_list sequence=array( bglight, bgdark )
<tr class="$Options.sequence">
{* Remove. *}Überschreiben Sie sie für ein Klassenattribut in einer override.ini.append.php mit Source=content/datatype/view/ezoption.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/ezoption/ezoptiontype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezoption.tpl, design/standard/templates/content/datatype/edit/ezoption.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.