The ezpackage datatype (Package)
Class eZPackageType in kernel/classes/datatypes/ezpackage/ezpackagetype.php; identifier ezpackage, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
What it stores
The columns of the attribute tables its class reads or writes: data_float, data_int, data_int1, data_text, data_text1 (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.
Sorting: sortKeyType() returns string.
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/ezpackage.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
if and( $attribute.has_content, $attribute.content )
<div class="block">
<img src=$attribute.content|ezpackage( thumbnail )|ezroot alt="$attribute.data_text|wash" />
</div>
/if
<div class="block">
$attribute.data_text|wash
</div>The shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezpackage.tpl (first 25 lines):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
default attribute_base=ContentObjectAttribute
{let package_attr_name=$attribute.data_text
package_list=fetch( package, list,
hash( filter_array, array( array( type, $attribute.contentclass_attribute.data_text1 ) ) ) )}
<div class="block">
<label for="ezpackage_data_text_$attribute.id_siteaccess">'Siteaccess'|i18n( 'design/standard/edit/' ):</label>
<select id="ezpackage_data_text_$attribute.id_siteaccess" name="CurrentSiteAccess">
<option value="Global">'Global (override)'|i18n( 'design/standard/edit/' )</option>
section name=SiteAccess loop=ezini('SiteAccessSettings','AvailableSiteAccessList')
<option value="$SiteAccess:item|wash"
foreach $package_list as $Package
if eq( concat( $Package.name, ':', $SiteAccess:item ), $attribute.data_text )
selected="selected"
set scope=root package_attr_name=$Package.name
break
/if
/foreach
>$:item|wash</option>
/section
</select>
</div>
<div class="block">
section name=Package loop=$:package_listOverride them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezpackage.tpl and a match on attribute_identifier (see A template override).
Related
Generated by ./console exp:help:examples from kernel/classes/datatypes/ezpackage/ezpackagetype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezpackage.tpl, design/standard/templates/content/datatype/edit/ezpackage.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.