Extension:PageProperties

 PageProperties  allows users to easily edit the display title, language and content model of a page; to associate semantic properties with pages without having to manually annotate them (provided that Semantic MediaWiki is installed); and to set SEO metadata for the entire wiki or for specific pages.

The extension adds an action to the top menu of wiki articles through which authorized users can set all the relevant properties of the page.

'''Since version 1.2.4 PageProperties features a complete GUI for the creation of semantic properties, semantic categories and semantic forms, completely based on OOUI and slots ! '''

The extension adds a tab "Edit semantic" to the page navigation, a section in the sidebar, and adds a link to the page menu action. The visibility of each of them can be managed using the parameters below





Installation

 * Download and place the file(s) in a directory called in your  folder.
 * Add the following code at the bottom of your LocalSettings.php
 * optionally run in the extension's folder, this will install the required libraries to annotate JSON-LD  within the page (see section below to find out more)
 * ✅ – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Main tab
From the main tab you can edit the display title of the page, language and content model. The display title can be left blank to hide the title completely without having to deal with [ https://www.hostknox.com/knowledgebase/703/How-to-hide-page-titles-in-MediaWiki.html css tricks].



Key features

 * set language is correctly shown in the Page information page
 * display title is added to the Page props table so that it can be autonomously handled by other extensions, like Display Title
 * optional tracking category "Pages with PageProperties"
 * support for html content model and enhanced support for plain text content model (in this case, the font of page content will be set to monospace, and white spaces/new lines will be preserved unless when necessary to fill line boxes)
 * properties are recorded within a dedicated slot on the related page and can be shown through the tab "properties" on the page menu (Attention: currently the content model of the slot is correctly displayed only on MediaWiki 1.38 and above, in other versions it will use the content model of the main slot)

(this tab is shown when the parameter is set to  or the user has  right)

SEO tab
From the SEO tab you can easily add meta tags or meta properties to specific pages or the entire wiki.

If the extension Extension:wikiSEO is installed, PageProperties will provide a combobox with the parameters allowed by the extension, and they will be internally handled by the WikiSEO extension itself without the need to manually annotate them on the page.

Note that the checkbox "apply to entire wiki" will be only shown if the properties are related to the Main Page of the wiki.



available combobox when the wikiSEO extension is installed

Edit semantic
(this feature is only available when Semantic MediaWiki is installed)

From the "Edit semantic" tab you can interactively assign semantic forms and single semantic properties to wiki pages without using parser functions and without annotating them manually on the page.

Set properties will be visible on the SMW FactBox and they will be correctly handled by [ https://www.semantic-mediawiki.org/wiki/Help:Inline_queries askqueries].



Here are the two "entry-points" to respectively add/remove forms to/from a page and add/remove single properties (unrelated to a specific form) to/from a page. Each property is associated to a OOUI input widget and can allow multiple fields.

This is a form once added to a page. The form is composed of properties defined through the "Manage properties" special page (see below) and then grouped in a form defined through the same page. Forms can be also used to create new articles as in Extension:PageForms (see also Manual:Forms).



The relevant sections for creating properties, categories, and even forms, are accessible from the "Edit semantic" tab itself, through the following icon (except for the tab "Semantic import" which is only accessible from the "Manage properties" special page)



Key-features
 * multiple forms and single properties can be interactively added to any wiki page
 * each form can feature their own default categories, pagename formula (only for new pages) and content model. When different between each other the user is provided with a radio input, to select the desired values
 * a large set of native OOUI inputs are available and can be added to a form through a simple interface
 * properties and forms can be edited/created seamlessly, without to leave the interface
 * supports the upload of multiple files

Manage properties
From the "Manage properties" special page you can create/edit semantic properties, semantic categories, semantic forms and even to perform a semantic import based on csv files.



Properties tab
This is where you can define a property. Supported options: all options related to properties listed [ https://www.semantic-mediawiki.org/wiki/Help:Special_properties/declarative here]
 * property type (any of those listed [ https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes here])
 * imported vocabulary (see [ https://www.semantic-mediawiki.org/wiki/Help:Import_vocabulary here])
 * multiple fields
 * preferred input



A large set of native Mediawiki's, and OOUI native inputs are supported, like:
 * mw.widgets.DateInputWidget
 * mw.widgets.datetime.DateTimeInputWidget
 * mw.widgets.CategoryMultiselectWidget
 * mw.widgets.TitlesMultiselectWidget
 * mw.widgets.UsersMultiselectWidget
 * OO.ui.MultilineTextInputWidget
 * OO.ui.TagMultiselectWidget
 * OO.ui.ComboBoxInputWidget
 * OO.ui.SelectFileWidget
 * [ https://github.com/jackocnr/intl-tel-input International Telephone Input] for [ https://www.semantic-mediawiki.org/wiki/Help:Type_Telephone_number telephone_number] data type

This demos page allows you to create web-applications using OOUI in JS or PHP



When you delete/rename a property all the pages containing that property will be affected as well, and the property will be either deleted or renamed on all relevant pages, so take into account the following tip!

Categories tab
This is where you can define a category. Supported options:
 * each category can be associated with any [ https://www.semantic-mediawiki.org/wiki/Help:Import_vocabulary imported vocabulary] saved on the wiki.



Forms tab
This is where you can define a form. Supported options:
 * pagename formula or title widget input
 * show/hide free text input
 * default categories
 * default content model

This is where (in the same window) you can assign fields to a form. Fields can be rearranged and through buttons located besides each of them you can access the related property window, and the field window.



This is where you can define the property/field assigned to a form. Supported options: on create only (whether the input should be used only to compose the form pagename formula)
 * required and default values
 * custom label (can override the property label with a localized message)
 * custom help text (can override with a localized message the property description if any)
 * preferred input (can override the same attribute of the related property)
 * option-values for multiple choice inputs retrieved from property declaration, hard-coded values, wikilist or an ask query (see [ https://commons.wikimedia.org/wiki/File:Screenshot-pageproperties-forms-option-values.png here])
 * mapping-formula - for inputs that are multiple choices, allow you to modify how they are displayed in the form, without modifying the actual property value, similar to mapping template in the PageForms extension.
 * multiple values (can override the same attribute of the related property)



Created forms will be listed in a dedicated section in the sidebar, as follows:



Import tab
From the "Import" tab you can import in your wiki csv files, mapping their fields to semantic properties defined or to be defined in the wiki. Also large set of csv lists can be incrementally imported and even previewed before the actual import through the interface. A page will be created for each csv entry, with a large set of options in order to define the target pagename, the page content, values separator, defined categories, and more !

Here is where you can upload/drop the cvs file to be imported.



Here is where you can check the consistency of your data and to set/remove the heading.



Here is where you can map the csv fields to semantic properties recorded in the wiki and even to create new properties on the fly.



Here is where you can preview the import, so to avoid or to minimize mistakes: note indeed that by default a single wiki page will be created for each csv entry.



Function #pagepropertiesform
The parser function can be used to display multiple forms in any wiki page, each of them composed by multiple forms (handled as form sections). Simply create a form through the interface as shown above, then use the following wikitext to render a composite form on the page.

where " Form a ", " Form b " and " Form c " are the names of different forms. After you have placed the forms on an article of your choice, a form submission will either create a new article based on the form's pagename formula or the title entered by the user in the form itself, or will trigger an error in case that an article with the same title already exists. By contrast, in order to edit the semantic properties of the current article, just use the Edit semantic tab. Finally, through this parser function, an arbitrary number of forms can be inserted in any article in the desired position.

Function #pagepropertiesformbutton
The parser function can be used to display a link button pointing to a new form rendered in a special page. The new form, as above, can in turn be composed by multiple forms.

where " text " is the button's text, " Form a ", " Form b " and " Form c " are the forms to be rendered on the special page, " button-type " is an optional parameter to determine whether the form button will be rendered as button or as text (use the values " button " and " text "), and class is an optional parameter to add to the button link one or more classes.

Function #pageproperties
The parser function can be used to easily display the semantic properties associated to a page, using templates, both for the given set of properties, and for each value of a given property (useful when a property contains multiple values, for instance pictures to be rendered in some way)

Example 2
Here the parser function will retrieve the value of the semantic property,  , will display the  using the template " Organization logo ", and will display such parameters using the template " Organization " (the value of the property Logo is translated using the desired template)

JSON-LD
JSON-LD  is "a method of encoding linked data using JSON" (source: JSON-LD). PageProperties automatically includes the ontology associated with the page, if any, in the following form: { "@context": { "name": "http://xmlns.com/foaf/0.1/name", "homepage": { "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage", "@type": "@id" },   "Person": "http://xmlns.com/foaf/0.1/Person" }, "@id": "https://me.example.com", "@type": "Person", "name": "John Smith", "homepage": "https://www.example.com/" }

This feature is available when PageProperties is used in conjunction with Semantic MediaWiki, and is especially useful, for the purpose of search engine optimization, when the wiki contains pages describing [ https://schema.org/docs/full.html schema.org items], like [ https://schema.org/Person Person], [ https://schema.org/Book Book], [ https://schema.org/Organization Organization] and more.

Configuration
The extension works at its best when used in conjunction with Semantic MediaWiki, WikiSEO and Display Title. However, none of them are necessary, when used without Semantic MediaWiki the semantic tab will be omitted, when used without WikiSEO meta tags have to be entered without a dropdown, and when used without Display Title it is possible that the alternate page title cannot be used for linking.

Global parameters
(n)  if user has right , otherwise

(if both and  are set to , the PageProperties special page will be not accessible from the interface)

Rights and privileges
The extension creates the following user rights. They can be both included manually in the LocalSettings.php or to be managed through the interface (special page Special:UserRights ).

Sysops and bureaucrats are assigned with the complete set of permissions by default.

Known issues

 * Subsequent edits of the name of a file through the specif implementation of do not yet update the name of the published file.  This will be fixed on a coming version.
 * rename of properties does not yet reflect on form descriptors
 * if the dedicated slot does contain unregistered properties, they won't be shown in the Edit semantic special page. This could change in future.

Demo & testing
You are welcome to test the extension on  wikienterprise.org 

Latest improvements

 * and  parser functions (forms can be inserted in any wiki article)
 * native input validation (with regard of the required attribute) for all OOUI inputs
 * dynamic option values for multiple choice input widgets, based on user's entered values, wiki-lists, and ask queries
 * hidden inputs
 * value-formula (keeps track of the original value, to be used for subsequent edits)
 * renaming/deletion of properties through the interface automatically updates all pages and forms with that property, with a notice about the jobs to be executed
 * categories created by the GUI are correctly handled in ask queries
 * optimized loading of required data
 * additional input widgets, namely Rating and ButtonMultiselectWidget

Roadmap

 * option-inputs with search api and infinite scroll (for long lists)
 * editable input label (done in version 1.2.5c)
 * subitems or subobjects
 * form sections (just add an option on the form panel "is form section" to disable other form main parameters, and inherit from the parent form, then add "form group")
 * searchable properties in slots and preload content
 * dedicated window for options of each available input, as outlined [ https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.TextInputWidget here] ( OO.ui.TextInputWidget as an example), consistent across Manage Properties and (Form edit's) Edit field
 * bulk edit
 * additional inputs, like tree and rating (done in version 1.2.5c: rating and multiple toggle buttons)
 * support Extension:Semantic_Interlanguage_Links

Support & bugs
Please post error messages in the Talk page of the extension. Updates will be posted on the [ https://sourceforge.net/p/semediawiki/mailman/semediawiki-user/main Semantic MediaWiki user list] and occasionally in the MediaWiki's [ https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/ Wikitech mailing list].

For professional support please use this [ https://wikisphere.org/wiki/Contact_form Contact form] (an Extension:CIForms's form)