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 ezmatrix (Matrix)

Der Datentyp ezmatrix (Matrix): was er speichert und wie Templates ihn verwenden.

Download as PDF

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

On this page

This page is a translation. Read the English original

Der Datentyp ezmatrix (Matrix)

Klasse eZMatrixType in kernel/classes/datatypes/ezmatrix/ezmatrixtype.php; Bezeichner ezmatrix, 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_text1, 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. Er ist von der Suche indiziert.

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/ezmatrix.tpl:

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{* A table: the column names, then one row per matrix row, nothing else (no <br /> between cells or rows;
   portions derived from LoveStack, mugoweb/ezpublish-legacy, commit 492a946963, Copyright (C) Mugo Web, GPL v2). *}
{def $matrix = $attribute.content}
<table class="list" cellspacing="0">
<tr>
{foreach $matrix.columns.sequential as $column}
<th>{$column.name|wash( xhtml )}</th>
{/foreach}
</tr>
{foreach $matrix.rows.sequential as $row sequence array( 'bglight', 'bgdark' ) as $row_style}
<tr class="{$row_style}">
    {foreach $row.columns as $cell}
    <td>{$cell|wash( xhtml )}</td>
    {/foreach}
</tr>
{/foreach}
</table>
{undef $matrix}

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

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

{* Matrix. *}
{section show=$matrix.rows.sequential}
<table class="list" cellspacing="0">

<tr>
    <th class="tight">&nbsp;</th>
    {section var=ColumnNames loop=$matrix.columns.sequential}<th>{$ColumnNames.item.name|wash( xhtml )}</th>{/section}
</tr>

{section var=Rows loop=$matrix.rows.sequential sequence=array( bglight, bgdark )}
<tr class="{$Rows.sequence}">

{* Remove. *}
<td><input id="ezcoa-{if ne( $attribute_base, 'ContentObjectAttribute' )}{$attribute_base}-{/if}{$attribute.contentclassattribute_id}_{$attribute.contentclass_attribute_identifier}_remove_{$Rows.index}" class="ezcc-{$attribute.object.content_class.identifier} ezcca-{$attribute.object.content_class.identifier}_{$attribute.contentclass_attribute_identifier}" type="checkbox" name="{$attribute_base}_data_matrix_remove_{$attribute.id}[]" value="{$Rows.index}" title="{'Select row for removal.'|i18n( 'design/standard/content/datatype' )}" /></td>

{* Custom columns. *}
{section var=Columns loop=$Rows.item.columns}
<td><input id="ezcoa-{if ne( $attribute_base, 'ContentObjectAttribute' )}{$attribute_base}-{/if}{$attribute.contentclassattribute_id}_{$attribute.contentclass_attribute_identifier}_matrix_cell_{$Rows.index}_{$Columns.index}" class="box ezcc-{$attribute.object.content_class.identifier} ezcca-{$attribute.object.content_class.identifier}_{$attribute.contentclass_attribute_identifier}" type="text" name="{$attribute_base}_ezmatrix_cell_{$attribute.id}[]" value="{$Columns.item|wash( xhtml )}" /></td>
{/section}

</tr>

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