Demo VisualData 1.0

From Wikisphere
Revision as of 12:34, 26 October 2023 by Admin (talk | contribs)

Demo VisualData
Jump to navigation Jump to search

{{#pagepropertiesprint: Demo VisualData |?cover |?title |?authors/name |?authors/email |schema=Book |template=Book |template?authors=Book authors }}

This is a page with an infobox that demonstrates the use of PageProperties (latest version) used as a CRUD

Click the button below to edit the article's metadata through a popup or the tab "Edit semantic" among the article's actions.


{{#pagepropertiesform: Book |title = edit infobox and page |action = edit |edit-page = Demo VisualData |return-page = |view = popup |popup-size = medium |css-class = |pagename=formula = |edit-freetext = true |edit-categories = false |edit-content-model = false |default-categories = |default-content-model = wikitext |layout-align = top |popup-help = true |submit-button-text = |layout = tabs |submit-button-text = |validate-button-text = }}


The popup is rendered using the following code

{{#pagepropertiesform: Book
|title = edit infobox and page
|action = edit
|edit-page = {{FULLPAGENAME}}
|return-page = 
|view = popup
|popup-size = medium
|css-class =
|pagename=formula =
|edit-freetext = true	
|edit-categories = false
|edit-content-model = false
|default-categories = 
|default-content-model = wikitext
|layout-align = top
|popup-help = true 
|submit-button-text =
|layout = tabs
|submit-button-text =
|validate-button-text =
}}

A Pageproperties' form can edit whatever page (through the parameter edit-pageand create new pages using a pagename formula. It is json/schema compliant[1] and can handle subitems, multiple fields and multiple sub items. It is deeply integrated with the Mediawiki's [OOUI library https://doc.wikimedia.org/oojs-ui/master/demos/] and uses a lot or most of its features. In the latest version can query properties and nested properties, to render them using templated and nested templates and does not rely on SemanticMediawiki.


The infobox is rendered through the following code

{{#pagepropertiesprint: {{FULLPAGENAME}}
|?cover
|?title
|?authors/name
|?authors/email
|schema=Book
|template=Book
|template?authors=Book authors
}}


This is a SemanticMediawiki-like parser function that can be used as a shorthand to invoke the more complex {{#pagepropertiesquery }} parser function that can handle multipage results and provides a basic query language.

The results are rendered on the page using 2 templates, Template:Book and [[Template:Book authors]. The second is used as a nested template rendered inside the parent template (Template:Book) entitled to render the properties with path

authors

. Note that the parent template must include a reference to the name of the child template since both values and template's containers are passed as named parameters.

  1. It does not yet support allOf, anyOf and oneOfa and $refs both in the editor and in the viewer

pageproperties

schemas
Book
title"The first men in the moon"
authors
first_name"Herbert "
last_name"Wells"
email""
name"Herbert Wells"
first_name"George"
last_name"Wells"
email""
name"George Wells"
cover"File:First_Men_in_the_Moon_(1901)_frontispiece.jpg"
schemas-data
untransformed
Book/authors/0/name""
Book/authors/1/name""
Book/cover"First_Men_in_the_Moon_(1901)_frontispiece.jpg"