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 ezimage (Bild)

Der Datentyp ezimage (Bild): was er speichert und wie Templates ihn verwenden.

Download as PDF

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

On this page

This page is a translation. Read the English original

Der Datentyp ezimage (Bild)

Klasse eZImageType in kernel/classes/datatypes/ezimage/ezimagetype.php; Bezeichner ezimage, aufgeführt in settings/content.ini [DataTypeSettings] AvailableDataTypes[].

Was er speichert

Die Spalten der Attributtabellen, die seine Klasse liest oder schreibt: data_int1, data_int2, 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. Er ist aus einer hochgeladenen Datei befüllbar.

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/ezimage.tpl (die ersten 25 Zeilen):

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{*
Input:
 image_class - Which image alias to show, default is large
 css_class     - Optional css class to wrap around the <img> tag, the
                 class will be placed in a <div> tag.
 alignment     - How to align the image, use 'left', 'right' or false().
 link_to_image - boolean, if true the url_alias will be fetched and
                 used as link.
 href          - Optional string, if set it will create a <a> tag
                 around the image with href as the link.
 border_size   - Size of border around image, default is 0
*}
{default image_class=large
         css_class=false()
         alignment=false()
         link_to_image=false()
         href=false()
         target=false()
         hspace=false()
         border_size=0
         border_color=''
         border_style=''
         margin_size=''
         alt_text=''

Das ausgelieferte Template, das ihn bearbeitet (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezimage.tpl (die ersten 25 Zeilen):

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{default attribute_base='ContentObjectAttribute'}
{let attribute_content=$attribute.content}
{def $alt_text_required = $attribute.contentclass_attribute.data_int2|eq( 1 )}

{* Current image. *}
<div class="block">
<label>{'Current image'|i18n( 'design/standard/content/datatype' )}:</label>
{if $attribute_content.original.is_valid}

<table class="list" cellspacing="0">
<tr>
    <th class="tight">{'Preview'|i18n( 'design/standard/content/datatype' )}</th>
    <th>{'Filename'|i18n( 'design/standard/content/datatype' )}</th>
    <th>{'MIME type'|i18n( 'design/standard/content/datatype' )}</th>
    <th>{'Size'|i18n( 'design/standard/content/datatype' )}</th>
</tr>
<tr>
    <td>{attribute_view_gui image_class=ezini( 'ImageSettings', 'DefaultEditAlias', 'content.ini' ) attribute=$attribute}</td>
    <td>{$attribute.content.original.original_filename|wash( xhtml )}</td>
    <td>{$attribute.content.original.mime_type|wash( xhtml )}</td>
    <td>{$attribute.content.original.filesize|si( byte )}</td>
</tr>
</table>
{else}

Überschreiben Sie sie für ein Klassenattribut in einer override.ini.append.php mit Source=content/datatype/view/ezimage.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/ezimage/ezimagetype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezimage.tpl, design/standard/templates/content/datatype/edit/ezimage.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