Template:VisualDataForm: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
{{VisualDataForm | {{VisualDataForm | ||
|schemas = | |schemas = | ||
|selected-schema = | |||
|title = | |title = | ||
|action = | |action = | ||
Line 39: | Line 40: | ||
"type": "string", | "type": "string", | ||
"required": true, | "required": true, | ||
"default": "", | |||
"example": "" | |||
}, | |||
"selected-schema": { | |||
"label": "selected-schema", | |||
"description": "the preselected schema if using more then one shema", | |||
"type": "string", | |||
"required": false, | |||
"default": "", | "default": "", | ||
"example": "" | "example": "" | ||
Line 167: | Line 176: | ||
"type": "string", | "type": "string", | ||
"required": false, | "required": false, | ||
"default": " | "default": "", | ||
"example": "" | "example": "" | ||
}, | }, | ||
Line 230: | Line 239: | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> | ||
<includeonly>{{#visualdataform:{{{schemas}}}|title = {{{title|}}}|action = {{{action|create}}}|view = {{{view|inline}}}|layout = {{{layout|tabs}}}|callback = {{{callback|}}}|edit-page = {{{edit-page|}}}|preload = {{{preload|}}}|preload-data = {{{preload-data|}}}|return-page = {{{return-page|}}}|popup-size = {{{popup-size|medium}}}|css-class = {{{css-class|}}}|pagename-formula = {{{pagename-formula|}}}|edit-freetext = {{{edit-freetext|}}}|edit-categories = {{{edit-categories|}}}|edit-content-model = {{{edit-content-model|}}}|target-slot = {{{target-slot| | <includeonly>{{#visualdataform:{{{schemas}}}|selected-schema = {{{selected-schema|}}}|title = {{{title|}}}|action = {{{action|create}}}|view = {{{view|inline}}}|layout = {{{layout|tabs}}}|callback = {{{callback|}}}|edit-page = {{{edit-page|}}}|preload = {{{preload|}}}|preload-data = {{{preload-data|}}}|return-page = {{{return-page|}}}|popup-size = {{{popup-size|medium}}}|css-class = {{{css-class|}}}|pagename-formula = {{{pagename-formula|}}}|edit-freetext = {{{edit-freetext|}}}|edit-categories = {{{edit-categories|}}}|edit-content-model = {{{edit-content-model|}}}|target-slot = {{{target-slot|}}}|edit-target-slot = {{{edit-target-slot|}}}|default-categories = {{{default-categories|}}}|default-content-model = {{{default-content-model|wikitext}}}|layout-align = {{{layout-align|top}}}|popup-help = {{{popup-help|}}}|submit-button-text = {{{submit-button-text|submit}}}|validate-button-text = {{{validate-button-text|validate}}} }} | ||
</includeonly> | </includeonly> | ||
Revision as of 08:49, 16 April 2024
{{VisualDataForm |schemas = |selected-schema = |title = |action = |view = |layout = |callback = |edit-page = |preload = |preload-data = |return-page = |popup-size = |css-class = |pagename-formula = |edit-freetext = |edit-categories = |edit-content-model = |target-slot = |edit-target-slot = |default-categories = |default-content-model = |layout-align = |popup-help = |submit-button-text = |validate-button-text = }}
Attention! VisualEditor won't handle the template correctly if it contains new lines!!
A parser function to enclose one or more schemas in a form
Parameter | Description | Type | Status | |
---|---|---|---|---|
schemas | schemas | one more schema name, comma separated
| String | required |
selected-schema | selected-schema | the preselected schema if using more then one shema
| String | optional |
title | title | title of the form (or the panel if a form containing multiple schemas)
| String | required |
action | action | form action, can be create or edit
| String | required |
view | view | display mode of the form, can be inline or popup
| String | required |
layout | layout | form layout with multiple schemas, can be tabs or booklet
| String | required |
callback | callback | (javascript) callback function called on submit
| String | optional |
edit-page | edit-page | title of the page holding the data to edit (with edit action)
| String | optional |
preload | preload | page name with preload wikitext
| String | optional |
preload data | preload-data | page name with preload json data
| String | optional |
return-page | return-page | return page
| String | optional |
popup-size | popup-size | popup-size, possible values: small, medium, large, larger full
| String | optional |
css-class | css-class | css-class to be attached to the form
| String | optional |
pagename-formula | pagename-formula | formula used to create a new article through the form with the entered data, in the form contacts/<first_name> <last_name>, where <first_name> and <last_name> are the property names of the related schema
| String | optional |
edit-freetext | edit-freetext | whether the form allows to edit freetext
| Boolean | optional |
edit-categories | edit-categories | whether the form allows to edit categories
| Boolean | optional |
edit-content-model | edit-content-model | whether the form allows to edit the content model
| Boolean | optional |
target-slot | target-slot | target slot for article metadata, could be jsondata or main
| String | optional |
edit target-slot | edit-target-slot | edit target slot
| Boolean | optional |
default-categories | default-categories | default categories (comma separated)
| String | optional |
default-content-model | default-content-model | default content model
| String | optional |
layout-align | layout-align | default align for the OO.ui.FieldLayout, possible values are left right top inline
| String | optional |
popup-help | popup-help | corresponds to helpinline set to false in the OO.ui.FieldLayout
| Boolean | optional |
submit-button-text | submit-button-text | text of the submit button
| String | optional |
validate-button-text | validate-button-text | text of the validate button
| String | optional |