Editing Demo VisualData/CRUD
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
The following demonstrates the creation of a | The following demonstrates the creation of a [https://en.wikipedia.org/wiki/Create,_read,_update_and_delete CRUD] (create, read, update, delete) interface performed through a button opening a popup form, a <code>pagepropertiesquery</code> parser function that creates the table, and a template, namely [[Template:Task_action]], rendered within the column "action", holding another form that edits the same schema ([[PagePropertiesSchema:Task]]) based on the data of the page with value <code><nowiki>{{{pagetitle}}}</nowiki></code>, where <code><nowiki>{{{pagetitle}}}</nowiki></code> is the title of the article related to each row of the generated table. (see the [https://www.mediawiki.org/wiki/Extension:PageProperties#Queries docs] for other parameters) | ||
The template is associated to the column "action" using the following wikitext | The template is associated to the column "action" using the following wikitext | ||
<pre> | <pre> | ||
Line 8: | Line 8: | ||
The form also demostrates the use of the option <code>target-slot = main</code> that instructs the form to save the json data to the main slot of the target article, as you can see [[ | The form also demostrates the use of the option <code>target-slot = main</code> that instructs the form to save the json data to the main slot of the target article, as you can see [[CRUD/12|here]]. Such data can then be edited through the edit button in the action column, through the tab "Edit semantic" in the target article, or even manually through "edit source" in the target article, and the changes will be reflected in the table below. | ||
The form also shows the integration of [https://www.mediawiki.org/wiki/Extension:VEForAll Extension:VEForAll] in the comments field. | The form also shows the integration of [https://www.mediawiki.org/wiki/Extension:VEForAll Extension:VEForAll] in the comments field. | ||
{{# | {{#pagepropertiesform: Task | ||
|title = Task | |title = Task | ||
|action = create | |action = create | ||
|edit-page = | |edit-page = | ||
|return-page = | |return-page = CRUD | ||
|view = popup | |view = popup | ||
|popup-size = large | |popup-size = large | ||
|css-class = | |css-class = | ||
|pagename-formula = | |pagename-formula =CRUD/<id-increment> | ||
|target-slot = main | |target-slot = main | ||
|edit-freetext = false | |edit-freetext = false | ||
Line 29: | Line 29: | ||
|default-content-model = wikitext | |default-content-model = wikitext | ||
|layout-align = top | |layout-align = top | ||
|popup-help = | |popup-help = true | ||
|submit-button-text = | |submit-button-text = | ||
|layout = tabs | |layout = tabs | ||
Line 38: | Line 38: | ||
{{# | {{#pagepropertiesquery: [[CRUD/~]] | ||
|schema=Task | |schema=Task | ||
|?assignee | |?assignee | ||
Line 51: | Line 51: | ||
Here are the components to implement it. | Here are the components to implement it. | ||
1) Json-schema describing the form: [[ | 1) Json-schema describing the form: [[PagePropertiesSchema:Task]] (created through the [[Special:ManageSchemas|Schema builder]]) | ||
2) parser function for the form | 2) parser function for the form popup | ||
<pre> | <pre> | ||
{{# | {{#pagepropertiesform: Task | ||
|title = Task | |title = Task | ||
|action = create | |action = create | ||
|edit-page = | |edit-page = | ||
|return-page = | |return-page = CRUD | ||
|view = popup | |view = popup | ||
|popup-size = large | |popup-size = large | ||
|css-class = | |css-class = | ||
|pagename-formula = | |pagename-formula =CRUD/<id-increment> | ||
|target-slot = main | |target-slot = main | ||
|edit-freetext = false | |edit-freetext = false | ||
Line 73: | Line 73: | ||
|default-content-model = wikitext | |default-content-model = wikitext | ||
|layout-align = top | |layout-align = top | ||
|popup-help = | |popup-help = true | ||
|submit-button-text = | |submit-button-text = | ||
|layout = tabs | |layout = tabs | ||
Line 85: | Line 85: | ||
<pre> | <pre> | ||
{{# | {{#pagepropertiesquery: [[CRUD/~]] | ||
|schema=Task | |schema=Task | ||
|?assignee | |?assignee | ||
Line 98: | Line 98: | ||
4) template [[Template:Task action]], containing another | 4) template [[Template:Task action]], containing another pageproperties form, as mentioned | ||
5) The | 5) The extension [https://www.mediawiki.org/wiki/Extension:IDProvider IDProvider] triggered from an hidden input in the same schema, and then used as <code>pagename-formula</code> | ||
6) The extension [https://www.mediawiki.org/wiki/Extension: | 6) The extension [https://www.mediawiki.org/wiki/Extension:VEForAll VEForAll] in order to display [https://www.mediawiki.org/wiki/Extension:VisualEditor VisualEditor] in the textarea | ||
== See also == | == See also == | ||
* [[Test pageproperties 2.0]] | |||
* [[New task]] | |||
* [[Page upload]] | |||
* [[Test pageproperties 2.0 - Result formats|Result formats]] | |||
* [[Test_pageproperties_2.0_-_Dependent_values|Dependent values]] | |||
* [[Test_pageproperties_2.0_-_Queries|Queries]] |