Vorlage:Feldgenerator: Unterschied zwischen den Versionen

Aus Splitterwiki
Zur Navigation springen Zur Suche springen
(upper case)
 
(10 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
   | Label
+
   |GehörtZu
 +
  |
 
}}
 
}}
 
</pre>
 
</pre>
Zeile 17: Zeile 18:
 
<table>
 
<table>
 
{{Feldgenerator
 
{{Feldgenerator
   | Label
+
   |GehörtZu
 +
  |
 
}}
 
}}
 
</table>
 
</table>
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
--><td class="formtable.Label" ><!--
+
--><td class="formtable.label" ><!--
   -->{{#show: Attribut:{{#var:Attribut}} | ?Label# | default={{#var:Attribut}} }}<!--
+
   -->{{#show: Attribut:{{#var:Attribut}} |?Label# |default={{#var:Attribut}} }}<!--
 
   --></td><!--
 
   --></td><!--
  
### erzeuge den Hilfetext als #info-Funktion
+
### starte die Tabellen-Zelle
--><td class="formtable.help" ><!--
+
--><td class="formtable.field" ><!--
-->{{#info: {{#show: Attribut:{{#var:Attribut}} | ?Hilfetext Attribut# }} }}<!--
 
  --></td><!--
 
  
 
### eröffne das field
 
### eröffne das field
--><td class="formtable.field" ><!--
 
 
--><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= {{!}} }}<!--
### Label
+
      -->{{#show: Attribut:{{#var:Attribut}} |?values# |intro== }}<!--
-->{{#show: Attribut:{{#var:Attribut}} | ?Label# | default={{#var:Attribut}} | intro = {{!}}Label=  }}<!--
+
    -->|<!--
 +
    -->}}<!--
 +
   -->}}<!--
 +
 
 +
### 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<!--
 
   -->}}<!--
 
   -->}}<!--
  
Zeile 89: Zeile 100:
 
--><nowiki>}}}</nowiki><!--
 
--><nowiki>}}}</nowiki><!--
  
### schließe die Zelle
+
### schließe die Tabellen-Zelle
 
   --></td><!--
 
   --></td><!--
### schließe die Tabellenzeile
+
### schließe die Tabellen-Zeile
 
   --></tr><!--
 
   --></tr><!--
  

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