Sjabloon:Token field: verschil tussen versies
Uit Auditpedia
(Nieuwe pagina aangemaakt met '<noinclude> This is the "Token field" template. It should be called in the following format: <pre> {{Token field |Field name=Name of the field |ID=Mandatory. Meanin...') |
|||
Regel 9: | Regel 9: | ||
|Selected values=comma seperated string of selected values. These are the current parameter values. | |Selected values=comma seperated string of selected values. These are the current parameter values. | ||
|Multiple= | |Multiple= | ||
+ | |Required= | ||
}} | }} | ||
</pre> | </pre> | ||
Regel 20: | Regel 21: | ||
-->{{#caunique:$token options}}<!-- | -->{{#caunique:$token options}}<!-- | ||
-->{{#vardefine: $multiple |{{{Multiple|}}} }}<!-- | -->{{#vardefine: $multiple |{{{Multiple|}}} }}<!-- | ||
− | --><wstoken name="{{{Field name|}}}[]" class="form-control" multiple="{{#var: $multiple}}" id="tokens-{{{ID|}}}" > | + | --><wstoken name="{{{Field name|}}}[]" class="form-control" multiple="{{#var: $multiple}}" id="tokens-{{{ID|}}}" {{#if: {{{Required|}}} |required="{{{Required|}}}"|}}> |
{{#tag:wsfield||type=option|value=}} | {{#tag:wsfield||type=option|value=}} | ||
{{#camap:$token options|__Optie__|{{#tag:wsfield|__Optie__|type=option|value=__Optie__|selected={{#if: {{#casearch:$selected values|__Optie__}}|selected}} |}} }} | {{#camap:$token options|__Optie__|{{#tag:wsfield|__Optie__|type=option|value=__Optie__|selected={{#if: {{#casearch:$selected values|__Optie__}}|selected}} |}} }} | ||
</wstoken> | </wstoken> | ||
</includeonly> | </includeonly> |
Versie van 17 feb 2022 12:36
This is the "Token field" template. It should be called in the following format:
{{Token field |Field name=Name of the field |ID=Mandatory. Meaningful name for field. |Available values=comma seperated string of available values. |Selected values=comma seperated string of selected values. These are the current parameter values. |Multiple= |Required= }}
The purpose of this template is to make it easy to create a token field. Edit the page to see the template text.