Domanda

I have defined a field

{{{field|state|default=new|input type=radiobutton}}}

pointing to the attribute state:

Dies ist ein Attribut des Datentyps [[Datentyp::Text]].

Die möglichen Werte für dieses Attribut sind:
* [[Erlaubt Wert::new]]
* [[Erlaubt Wert::accepted]]
* [[Erlaubt Wert::rejected]]
* [[Erlaubt Wert::postponed]]

How is it possible to change the field definition to a combobox where additional values can be added?

È stato utile?

Soluzione

According to:

values dependent on=template name[field name] - Can be used for inputs of type 'combobox', 'text with autocomplete', 'textarea with autocomplete' and 'tokens'. Specifies that the current set of allowed values for this field are all the values taken by this same field from pages where "field name" is equal to the value selected for "field name" in the current form. For example, if a template is called "Restaurant" and it has template fields (not properties) named "Country" and "City", and you want the set of cities that are used for autocompletion to be only those cities in the country that the user selected, then the field tag for the City field should look something like: {{{field|City|input type=combobox|values dependent on=Restaurant[Country]}}}.

Values dependent on lets you specify a semantic query to refine which allowed values to use.

Altri suggerimenti

According to mediawiki.org it is possbile to allow custom values via

{{{field|state|default=new|input type=combobox}}}

but the new values will not be saved into the attribute's definition.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top