Der Datentyp ezprice (Preis)
Klasse eZPriceType in kernel/classes/datatypes/ezprice/ezpricetype.php; Bezeichner ezprice, aufgeführt in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
Was er speichert
Die Spalten der Attributtabellen, die seine Klasse liest oder schreibt: data_float, data_float1, data_int1, data_text (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 int zurück.
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/ezprice.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
if $attribute.content.has_discount
'Price'|i18n( 'design/standard/content/datatype' ): <strike>$attribute.content.inc_vat_price|l10n( currency )</strike> <br>
'Your price'|i18n( 'design/standard/content/datatype' ): $attribute.content.discount_price_inc_vat|l10n( currency )<br>
'You save'|i18n( 'design/standard/content/datatype' ): sub($attribute.content.inc_vat_price,$attribute.content.discount_price_inc_vat)|l10n( currency ) ( $attribute.content.discount_percent % )
else
'Price'|i18n( 'design/standard/content/datatype' ) $attribute.content.inc_vat_price|l10n( currency )<br>
/ifDas ausgelieferte Template, das ihn bearbeitet (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezprice.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_price">'Price'|i18n( 'design/standard/class/datatype' ):</label>
<input id="ezcoa-if ne( $attribute_base, 'ContentObjectAttribute' )$attribute_base-/if$attribute.contentclassattribute_id_$attribute.contentclass_attribute_identifier_price" class="ezcc-$attribute.object.content_class.identifier ezcca-$attribute.object.content_class.identifier_$attribute.contentclass_attribute_identifier" type="text" name="$attribute_base_data_price_$attribute.id" size="12" value="$attribute.content.price|l10n( clean_currency )" />
if $attribute.class_content.is_vat_included
{* Entered price already includes VAT. *}
else
(+ $attribute.content.selected_vat_type.name|wash, $attribute.content.selected_vat_type.percentage|wash%)
/if
</div>
<div class="block">
<label for="ezcoa-if ne( $attribute_base, 'ContentObjectAttribute' )$attribute_base-/if$attribute.contentclassattribute_id_$attribute.contentclass_attribute_identifier_vat">'VAT'|i18n( 'design/standard/class/datatype' ):</label>
<select id="ezcoa-if ne( $attribute_base, 'ContentObjectAttribute' )$attribute_base-/if$attribute.contentclassattribute_id_$attribute.contentclass_attribute_identifier_vat" class="ezcc-$attribute.object.content_class.identifier ezcca-$attribute.object.content_class.identifier_$attribute.contentclass_attribute_identifier" name="$attribute_base_ezprice_inc_ex_vat_$attribute.id">
<option value="1" if eq( $attribute.content.is_vat_included, true() )selected="selected"/if>'Price inc. VAT'|i18n( 'design/standard/class/datatype' )</option>
<option value="2" if eq( $attribute.content.is_vat_included, false() )selected="selected"/if>'Price ex. VAT'|i18n( 'design/standard/class/datatype' )</option>
</select>
</div>
<div class="block">
<label>'VAT type'|i18n( 'design/standard/class/datatype' ):</label>
{include uri='design:shop/vattype/edit.tpl'
select_name=concat( $attribute_base, "_ezprice_vat_id_", $attribute.id )Überschreiben Sie sie für ein Klassenattribut in einer override.ini.append.php mit Source=content/datatype/view/ezprice.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/ezprice/ezpricetype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezprice.tpl, design/standard/templates/content/datatype/edit/ezprice.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.