Difference between revisions of "MultiTextWizard"

From Contao Community Documentation

(Created page with 'Kategorie:Extensions Auszeichnungen zum Kategorisieren von Elementen. {{ExtInfo | Dev=Helmut Schottmüller (hschottm) | DevSite=http://www.aurealis.de | E…')
 
Line 1: Line 1:
[[Kategorie:Extensions]]
+
[[Category:Extensions]]
  
 
Auszeichnungen zum Kategorisieren von Elementen.
 
Auszeichnungen zum Kategorisieren von Elementen.
Line 7: Line 7:
 
| DevSite=http://www.aurealis.de
 
| DevSite=http://www.aurealis.de
 
| ExtVersion=1.1.0
 
| ExtVersion=1.1.0
| Version=ab 2.7
+
| Version=from 2.7
| ERLink=http://www.contao.org/erweiterungsliste/view/MultiTextWizard.de.html
+
| ERLink=http://www.contao.org/extension-list/view/MultiTextWizard.en.html
| DonateLink=http://aurealis.de/spenden.html
+
| DonateLink=http://aurealis.de/donate.html
 
}}
 
}}
  
== MultiTextWizard (Mehrere Textfelder pro Zeile) ==
+
== MultiTextWizard (Multiple text fields in a row) ==
MultiTextWizard ist ein Contao Widget zur Eingabe von mehren Textfeldern pro Zeile innerhalb eines Backend-Formulars. Die Anzahl der Textfelder pro Zeile und ein optionales Array mit den Spaltenüberschriften können als Parameter für dieses Widget verwendet werden.
+
MultiTextWizard is a Contao widget to enter multiple text fields in a row inside a backend form. The number of text fields per row and an optional array containing column headings could be used as parameters for this widget.
  
[[Datei:multitextwizard.png|center|frame|Ausgabe einer MultitextWizard-Eingabe mit zwei Spalten im Contao Backend]]
+
[[File:multitextwizard_en.png|center|frame|Output of a MultitextWizard element with two columns in the Contao backend]]
  
=== Einbinden von MultiTextWizard in Backend-Formulare ab Version 1.1.0 (empfohlen) ===
+
=== Embedding MultiTextWizard in backend forms since version 1.1.0 (recommended) ===
  
Die Einbindung von MultiTextWizard ist denkbar einfach. Über einen einzigen eval-Parameter kann die Multitext-Matrix mit Überschriften und Überprüfungen eingegeben werden.
+
Embedding MultiTextWizard is quite easy. You just need a single eval parameter to define the MultiText matrix with headings and content checks.
  
 
<source type="php">
 
<source type="php">
Line 51: Line 51:
 
</source>
 
</source>
  
d.h. es können pro Spalte ein optionaler Bezeichner (''name''), eine Spaltenüberschrift (''label''), eine optionale Angabe als Pflichtfeld (''mandatory'') und ein optionaler regulärer Ausdruck zur Überprüfung des Inhaltes (''rgxp'') angegeben werden. Falls die optionalen Angaben ''mandatory'' und ''rgxp'' herkömmlich im eval-Array des DCA-Containers definiert sind, werden diese für alle Spalten übernommen. Eine Definition im ''columns'' Array überschreibt die globalen Einstellungen des DCA-Containers.
+
This means you can add an optional identifier (''name''), a heading (''label''), an optional mandatory check (''mandatory''), and an optional regular expression for a content check (''rgxp'') for each single column. If you define the optional values ''mandatory'' and ''rgxp'' in the default way inside the parent layer of the DCA container's eval array, these settings will be used for all columns as a default. An additional definition in the  ''columns'' array overwrites the global settings of the DCA container.
  
Durch die individuelle Vergabe von Pflichtfeldern und Prüfungen für einzelne Spalten fallen jetzt auch die Fehlermeldungen für ein MultiTextWizard Element detaillierter aus. Einerseits werden bei Pflichtspalten die einzelnen Spalten in der Spaltenüberschrift gekennzeichnet, außerdem wird unter jedem fehlerhaften Eingabefeld eine entsprechende Fehlermeldung angezeigt:
+
By defining individual mandatory fields and checks for each column the use receives individual feedback as well if an error occurs. Every column will be marked individually as a mandatory column if the mandatory setting is activated. Error messages will occur under each conflicting input field and show a detailed error message for this exact field:
  
[[Datei:multitextwizard_error.png|center|frame|Fehlermeldungen eines MultiTextWizard Elements]]
+
[[File:multitextwizard_error_en.png|center|frame|Error messages of a MultiTextWizard element]]
  
=== Einbinden von MultiTextWizard in Backend-Formulare vor Version 1.1.0 ===
+
=== Embedding MultiTextWizard in backend forms before version 1.1.0 ===
  
Die Einbindung von MultiTextWizard ist denkbar einfach. Die Anzahl der verfügbaren Spalten lässt sich über den Parameter columns angeben. Optional kann über den Parameter labels ein Array mit columns Elementen angegeben werden, dessen Inhalte dann als Spaltenüberschriften interpretiert und ausgegeben werden.
+
Embedding MultiTextWizard is pretty simple. The number of columns is given by the required parameter columns. If you need column headings you can use the optional parameter labels which should contain an array of n = columns elements. These elements will be used as column headings.
  
Das folgende Beispiel illustriert die Einbindung von MultiTextWizard innerhalb eines field-Arrays in einem Contao Datacontainer:
+
See the following example how to embed MultiTextWizard inside a Contao data container field array:
  
 
<source type="php">
 
<source type="php">

Revision as of 12:35, 1 September 2010


Auszeichnungen zum Kategorisieren von Elementen.


Extension-Overview
Name of the developer Helmut Schottmüller (hschottm)
Developer Website http://www.aurealis.de
Version of the extension 1.1.0
Compatibility with Contao Version from 2.7
Link to Extension Repository http://www.contao.org/extension-list/view/MultiTextWizard.en.html
Donate the developer http://aurealis.de/donate.html


MultiTextWizard (Multiple text fields in a row)

MultiTextWizard is a Contao widget to enter multiple text fields in a row inside a backend form. The number of text fields per row and an optional array containing column headings could be used as parameters for this widget.

Output of a MultitextWizard element with two columns in the Contao backend

Embedding MultiTextWizard in backend forms since version 1.1.0 (recommended)

Embedding MultiTextWizard is quite easy. You just need a single eval parameter to define the MultiText matrix with headings and content checks.

'fields' => array
(
  'authors' => array
  (
    'label'     => &$GLOBALS['TL_LANG']['tl_literature']['authors'],
    'inputType' => 'multitextWizard',
    'eval'      => array
      (
        'style'=>'width:100%;',
        'columns' => array
          (
            array
            (
              'name' => 'firstname', // optional
              'label' => &$GLOBALS['TL_LANG']['tl_literature']['firstname'],
              'mandatory' => false, // optional
            ),
            array
            (
              'name' => 'lastname',  // optional
              'label' => &$GLOBALS['TL_LANG']['tl_literature']['lastname'],
              'mandatory' => true, // optional
              'rgxp' => 'alpha', // optional
            )
          )
       )
  ),

This means you can add an optional identifier (name), a heading (label), an optional mandatory check (mandatory), and an optional regular expression for a content check (rgxp) for each single column. If you define the optional values mandatory and rgxp in the default way inside the parent layer of the DCA container's eval array, these settings will be used for all columns as a default. An additional definition in the columns array overwrites the global settings of the DCA container.

By defining individual mandatory fields and checks for each column the use receives individual feedback as well if an error occurs. Every column will be marked individually as a mandatory column if the mandatory setting is activated. Error messages will occur under each conflicting input field and show a detailed error message for this exact field:

Error messages of a MultiTextWizard element

Embedding MultiTextWizard in backend forms before version 1.1.0

Embedding MultiTextWizard is pretty simple. The number of columns is given by the required parameter columns. If you need column headings you can use the optional parameter labels which should contain an array of n = columns elements. These elements will be used as column headings.

See the following example how to embed MultiTextWizard inside a Contao data container field array:

'fields' => array
(
  'authors' => array
  (
    'label'     => &$GLOBALS['TL_LANG']['tl_literature']['authors'],
    'inputType' => 'multitextWizard',
    'eval'      => array
      (
        'mandatory' => false, 
        'doNotSaveEmpty'=>true, 
        'style'=>'width:142px;', 
        'columns' => 2, 
        'labels' => array
          (
            &$GLOBALS['TL_LANG']['tl_literature']['firstname'], 
            &$GLOBALS['TL_LANG']['tl_literature']['lastname']
          )
       )
  ),

--Hschottm 11:23, 1 September 2010 (CEST)

Views
Personal tools

Contao Community Documentation

Navigation
Discover
Understand
Enhance
Miscellaneous
Tools