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.



If Semantic MediaWiki is installed it also adds a section in the sidebar



(otherwise it will add an entry in the Tools section).

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.

Migration from previous version (1.0.3 and below)
 * Run  (this will migrate all properties stored in the dedicated table, to a special slot of related pages)

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.



Version 1.1.0 improvements:
 * support for default values of display title and language
 * language is correctly shown in the Page information page
 * display title is added to the Page props table table so that it can be autonomously handled by other extesions, like Display Title
 * if content model is "plain text", the font of page content will be set to monospace, and white spaces (like new lines) will be preserved unless when necessary to fill line boxes (css: )

-

Semantic properties tab
From the Semantic properties tab you can register semantic properties to the related page without annotating them manually. Same properties can have multiples values, and they will be handled correctly by askqueries and shown on the FactBox.



Version 1.1.0 improvements:
 * no edit of the Semantic MediaWiki code necessary
 * fields type are automatically shown as placeholder, also for imported properties
 * properties are stored using a dedicated slot
 * property definitions can be created using the Manage Properties special page (see below)
 * JSON-LD automatically created from recorded properties (also manually annotated on the page as usual)



-

SEO
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 is installed

Manage Properties
The Manage Properties special page allows to create, edit, remove and rename properties without to deal with property pages. Renamed properties already annotated will be automatically updated in all the pages which make use of them. Manage Properties supports properties imported through imported vocabularies and handles correctly their types.



List of available property types: they depend both on the default SMW datatyes and the imported vocabulary like schema.org: so it is completely up to you!

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/" }

Of course the feature is especially useful when PageProperties is used in conjunction with Semantic MediaWiki, and when the page includes semantic properties, especially, for the purpose of search engine optimization, semantic properties imported from the schema.org vocabulary.

See here for more information how Google handles that. Here are the properties expected by Google for an item of type "book", so in order to have a wiki page recognized by Google as a book, you have to do the following steps:


 * import the schema.org vocabulary as shown here
 * create a property named "Book title" with type schema:name through the Manage Properties special page
 * associate the category  to the schema.org item type "book" entering   in the category's page (in a coming version this will be handled by PageProperties as well)
 * create more local properties to define a book and associate each of them to the schema.org vocabulary following this reference
 * that's it! Now your book item in the wiki is fully recognizable by search engines or other platforms for linked data and highly accessible on the Web!

Configuration
The extensions works at its best when used in conjunction with Extension:Semantic_MediaWiki, Extension:WikiSEO and Extension:Display_Title. However, none of them are necessary, when used without Semantic Mediawiki the semantic tab will be omitted (as well as the Special page Manage Properties), 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

Known issues

 * If you have a lot of properties registered on the wiki, or you are importing a lot of properties from external vocabularies (like for instance the following), the page Manage Properties will take a while to be ready client-side due to OOUI infusion. This can be temporarily solved importing only the required subset of properties from external vocabularies. A coming version of PageProperties will offer an alternate design in order to solve the issue without any requirement or work-around.


 * The combobox of Mediawiki's OOUI library does not display optgroups correctly on menus (i.e. they will not show as in this picture). I will propose/commit a patch as soon as possible to the official library.

Support & bugs
Please post error messages in the Talk page of the extension. Updates will be posted on the main MediaWiki mailing list mediawiki-l so we advice you to subscribe to the list to stay tuned with them.