Vorlage:Feldgenerator: Unterschied zwischen den Versionen

Aus Splitterwiki
Zur Navigation springen Zur Suche springen
K ((layout))
 
(18 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 3: Zeile 3:
 
Sie sollte im folgenden Format genutzt werden:
 
Sie sollte im folgenden Format genutzt werden:
 
<pre>
 
<pre>
{{Feldgenerator|<Attribut>}}
+
{{Feldgenerator|<Attribut>|<Values>}}
 
</pre>
 
</pre>
wobei ''<Attribut>'' (Pflichtangabe) der Attributsname  ist, aus dem heraus das Formularfeld generiert wird (ohne den Namespace, also zum Beispiel "Wappen" statt "Attribut:Wappen").
+
wobei ''<Attribut>'' (Pflichtangabe) der Attributsname  ist, aus dem heraus das Formularfeld generiert wird (ohne den Namespace, also zum Beispiel "Wappen" statt "Attribut:Wappen"). ''<Values>'' ist optional, falls die Werte-Auswahl des Feldes nicht zentral sondern spezifisch gefüllt werden soll (also der Eintrag "|values=x,y,z" spezifisch sein soll).
  
 
== Beispiel ==
 
== Beispiel ==
Zeile 11: Zeile 11:
 
<pre>
 
<pre>
 
{{Feldgenerator
 
{{Feldgenerator
   | Autoren
+
   |GehörtZu
 +
  |
 
}}
 
}}
 
</pre>
 
</pre>
 
=== Ausgabe ===
 
=== Ausgabe ===
<div class="textbox hellgrau" >
+
<table>
 
{{Feldgenerator
 
{{Feldgenerator
   | Autoren
+
   |GehörtZu
 +
  |
 
}}
 
}}
</div>
+
</table>
  
 
Klick auf „Bearbeiten“, um den Quelltext der Vorlage anzusehen.
 
Klick auf „Bearbeiten“, um den Quelltext der Vorlage anzusehen.
Zeile 38: Zeile 40:
 
### Ausgabe
 
### Ausgabe
 
##############################################################
 
##############################################################
### starte die Tabellenzeile
+
 
 +
### starte die Tabellen-Zeile
 
--><tr><!--
 
--><tr><!--
 +
 +
### erzeuge den Hilfetext als #info-Funktion
 +
--><td class="formtable.help" ><!--
 +
-->{{#info: {{#show: Attribut:{{#var:Attribut}} |?Hilfetext Attribut# }} }}<!--
 +
  --></td><!--
  
 
### zeige das Label an
 
### zeige das Label an
--><th><!--
+
--><td class="formtable.label" ><!--
-->{{#show: Attribut:{{#var:Attribut}} | ?Label# | default={{#var:Attribut}} }}<!--
+
  -->{{#show: Attribut:{{#var:Attribut}} |?Label# |default={{#var:Attribut}} }}<!--
   ### erzeuge den Hilfetext als #info-Funktion
+
   --></td><!--
  -->&nbsp;{{#info: {{#show: Attribut:{{#var:Attribut}} | ?Hilfetext Attribut# }} }}<!--
+
 
  --></th><!--
+
### starte die Tabellen-Zelle
 +
--><td class="formtable.field" ><!--
  
 
### eröffne das field
 
### eröffne das field
--><td><!--
 
 
--><nowiki>{{{field|</nowiki><!--
 
--><nowiki>{{{field|</nowiki><!--
 +
 
### Attribut name
 
### Attribut name
 
-->{{#var:Attribut}}<!--
 
-->{{#var:Attribut}}<!--
 
### input type
 
### input type
-->{{#show: Attribut:{{#var:Attribut}} | ?input type# | intro= {{!}}input type= }}<!--
+
-->{{#show: Attribut:{{#var:Attribut}} |?input type# |intro= {{!}}input type= }}<!--
 
### Auswahlliste
 
### Auswahlliste
-->{{#if: {{#show: Attribut:{{#var:Attribut}} | ?values from }}<!--
+
-->{{#if: {{{2|}}}<!--
  -->| {{#show: Attribut:{{#var:Attribut}} | ?values from# | intro= {{!}} }} <!--
+
  -->| {{!}}values={{{2}}}<!--
    --> {{#show: Attribut:{{#var:Attribut}} | ?values# | intro= = }} <!--
+
  -->| {{#if: {{#show: Attribut:{{#var:Attribut}} |?values from }}<!--
   -->|}}<!--
+
    -->| {{#show: Attribut:{{#var:Attribut}} |?values from# |intro= {{!}} }}<!--
 +
      -->{{#show: Attribut:{{#var:Attribut}} |?values# |intro== }}<!--
 +
    -->|<!--
 +
    -->}}<!--
 +
   -->}}<!--
 +
 
 
### label
 
### label
-->{{#show: Attribut:{{#var:Attribut}} | ?label# | default={{#var:Attribut}} | intro = {{!}}label=  }}<!--
+
-->{{#show: Attribut:{{#var:Attribut}} |?label# |default={{#var:Attribut}} |intro = {{!}}label=  }}<!--
 
### Hilfetext Attribut
 
### Hilfetext Attribut
-->{{#show: Attribut:{{#var:Attribut}} | ?Hilfetext Attribut# | intro = {{!}}tooltip=  }}<!--
+
-->{{#show: Attribut:{{#var:Attribut}} |?Hilfetext Attribut# |intro = {{!}}tooltip=  }}<!--
 
### placeholder
 
### placeholder
-->{{#show: Attribut:{{#var:Attribut}} | ?placeholder# | intro = {{!}}placeholder=  }}<!--
+
-->{{#show: Attribut:{{#var:Attribut}} |?placeholder# |intro = {{!}}placeholder=  }}<!--
 
### mandatory  
 
### mandatory  
-->{{#if: {{#show: Attribut:{{#var:Attribut}} | ?mandatory }}<!--
+
-->{{#if: {{#show: Attribut:{{#var:Attribut}} |?mandatory }}<!--
   -->| {{!}}mandatory <!--
+
   -->|{{!}}mandatory<!--
 
   -->}}<!--
 
   -->}}<!--
 
### existing values only
 
### existing values only
   -->{{#if: {{#show: Attribut:{{#var:Attribut}} | ?existing values only}}<!--
+
   -->{{#if: {{#show: Attribut:{{#var:Attribut}} |?existing values only}}<!--
   -->| {{!}}existing values only<!--
+
   -->|{{!}}existing values only<!--
 
   -->}}<!--
 
   -->}}<!--
 
### autogrow
 
### autogrow
   -->{{#if: {{#show: Attribut:{{#var:Attribut}} | ?autogrow}}<!--
+
   -->{{#if: {{#show: Attribut:{{#var:Attribut}} |?autogrow}}<!--
   -->| {{!}}autogrow{{!}}rows=1<!--
+
   -->|{{!}}autogrow{{!}}rows=1<!--
 
   -->}}<!--
 
   -->}}<!--
 
### uploadable  
 
### uploadable  
   -->{{#if: {{#show: Attribut:{{#var:Attribut}} | ?uploadable }}<!--
+
   -->{{#if: {{#show: Attribut:{{#var:Attribut}} |?uploadable }}<!--
   -->| {{!}}uploadable{{!}}image preview <!--
+
   -->|{{!}}uploadable{{!}}image preview<!--
 
   -->}}<!--
 
   -->}}<!--
### schließe die Zelle
 
  --></td><!--
 
### schließe die Tabellenzeile
 
  --></tr><!--
 
  
 
### schließe das field
 
### schließe das field
 
--><nowiki>}}}</nowiki><!--
 
--><nowiki>}}}</nowiki><!--
 +
 +
### schließe die Tabellen-Zelle
 +
  --></td><!--
 +
### schließe die Tabellen-Zeile
 +
  --></tr><!--
  
 
##############################################################
 
##############################################################
  
 
--></includeonly>
 
--></includeonly>

Aktuelle Version vom 18. Oktober 2020, 21:09 Uhr

Dies ist die Vorlage „Feldgenerator“. Sie sollte im folgenden Format genutzt werden:

{{Feldgenerator|<Attribut>|<Values>}}

wobei <Attribut> (Pflichtangabe) der Attributsname ist, aus dem heraus das Formularfeld generiert wird (ohne den Namespace, also zum Beispiel "Wappen" statt "Attribut:Wappen"). <Values> ist optional, falls die Werte-Auswahl des Feldes nicht zentral sondern spezifisch gefüllt werden soll (also der Eintrag "|values=x,y,z" spezifisch sein soll).

Beispiel

Eingabe

{{Feldgenerator
  |GehörtZu
  |
}}

Ausgabe

ist dieser Artikel - in welcher Art auch immer - einem anderen Artikel zugehörig? Hier eintragen!Gehört zu…{{{field|GehörtZu|input type=tokens|values from namespace=Main|label=Gehört zu…|tooltip=ist dieser Artikel - in welcher Art auch immer - einem anderen Artikel zugehörig? Hier eintragen!|placeholder=Pflichtfeld|mandatory|existing values only}}}

Klick auf „Bearbeiten“, um den Quelltext der Vorlage anzusehen.

Bearbeiten