Extension:PageProperties

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

The extension adds an action on the top menu of Wiki articles and then 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, semantic forms, completely based on OOUI and slots ! '''

The extension adds an "edit semantic" tab on the page navigation, a section in the sidebar, and a link in 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 css tricks.



Key features:
 * 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 the content of additional slots will be shown using the content model of the main slot)

(for this tab to be shown, set the parameter  to true)

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

If the extension Extension:wikiSEO is installed, PageProperties will show 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 Extension:wikiSEO extension is installed

Edit semantic
(this feature is only available provided that 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 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.

This is a form once added to page. The form is composed of properties defined through the "Manage properties" special page (see below) and then "assembled" in a form defined through the same page.



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 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 page

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:
 * property type (any of those listed here)
 * imported vocabulary (see here)
 * multiple fields
 * preferred input
 * all options related to properties listed here





A large set of native Mediawiki's, and OOUI native inputs are supported like
 * OO.ui.TagMultiselectWidget
 * International Telephone Input for telephone_number data type
 * OO.ui.TagMultiselectWidget
 * International Telephone Input for telephone_number data type
 * International Telephone Input for telephone_number data type

and more !



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 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 properties to a form. Properties can be rearranged and 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:
 * required
 * field label (can override the same attribute of the related property)
 * preferred input (can override the same attribute of the related property)
 * multiple values (can override the same attribute of the related property)
 * on create only (whether the input should be used only to compose the form pagename formula)



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 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 if where you check the consistency of your data and set the data heading.

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

Here if 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.



JSON-LD
JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding linked data using JSON (from Wikipedia). 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 schema.org items, like Person, Book, 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

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

Rights and privileges
The extension creates the user rights "Can edit page properties (Page Properties)" and "Can manage property declarations (Page Properties)" and the group memberships "editor of page properties (Page Properties)" and "editor of property declarations (Page Properties)".

Sysops and bureaucrats are assigned to such groups by default. If you want to grant regular users the right to manage the properties related to pages or to manage property declarations (where SemanticMediaWiki is installed), use the special page Special:UserRights.

Example configuration:

Known issues

 * Since version 1.2.0 PageProperties works well with wikis containing up to a few hundreds of property declarations (i.e. pages in the "Property:" namespace). If the wiki contains thousands of property declarations, you could experience slow downs.

Support & bugs
Please post error messages in the Talk page of the extension. Updates will be posted on the Semantic MediaWiki user list and occasionally in the MediaWiki's Wikitech mailing list.

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