Extension:PageProperties

MediaWiki extensions manual
PageProperties
Release status: stable
Implementation Hook , Special page
Description Allows to easily edit the display title , language and content model of a page, and to set SEO metadata for the entire wiki or for specific pages
Author(s) thomas-topway-it (thomas-topway-ittalk)
Latest version 1.5.2 (2024-08-03)
Compatibility policy Master maintains backward compatibility.
MediaWiki >= 1.35.0
License GNU General Public License 2.0 or later
Download
  • $wgPagePropertiesDisplayAlwaysUnprefixedTitles
  • $wgPagePropertiesAddTrackingCategory
  • $wgPagePropertiesDisableNavigationLink
  • $wgPagePropertiesDisableVersionCheck
  • $wgPagePropertiesDisableSidebarLink
  • pageproperties-caneditpageproperties
Quarterly downloads 31 (Ranked 102nd)
Translate the PageProperties extension if it is available at translatewiki.net

PageProperties allows to easily edit the display title, language and content model of a page, and to set SEO metadata for the entire wiki or for specific pages.


UI elements

The extension adds a link in the navigation menu and a link on the sidebar, within the "Tools" section: their visibility can be handled using the parameters below

  • The action-link "Page properties"

 

  • The sidebar link pointing to the same special page

 

Installation

  • Download and place the file(s) in a directory called PageProperties in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php
wfLoadExtension( 'PageProperties' );
  • optionally run composer update --no-dev in the extension's folder, this will install the required libraries to annotate JSON-LD[1] within the page (see section below to find out more)
  • Run php maintenance/update.php (this will install the required tables)
  • follow the instructions here to migrate from previous versions of PageProperties if applicable
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.



Page Properties' Special page

Page Properties' special page is a convenient special page where to quickly set display title, language and content model of a page, as well as to associate SEO metadata at page level or site level (if accessed from the Main Page). It works at its best when used in conjunction with WikiSEO and Display Title . However, they aren't strictly necessary, 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.

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

  • 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)

SEO tab

From the SEO[2] 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

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.

Rights

right description
pageproperties-caneditpageproperties Can edit page properties

Example configuration

$wgPagePropertiesDisableJsonLD = true;

$wgGroupPermissions['*']["pageproperties-caneditpageproperties"] = false;

Groups

group Can edit page properties
sysop, bureaucrat    
pageproperties-admin    
pageproperties-editor    

Global parameters

variable description default
$wgPagePropertiesAddTrackingCategory add the Tracking category "Pages with PageProperties" on pages containing properties false
$wgPagePropertiesDisableSidebarLink hide the link to the PageProperties special page on the sidebar false
$wgPagePropertiesDisableNavigationLink hide the link to the PageProperties special page on the navigation panel false
$wgPagePropertiesOpenExternalLinksInNewTab inserts an attribute target="_blank" to all external links, so they open in a new tab false
$wgPagePropertiesDisplayAlwaysUnprefixedTitles display unprefixed titles for all namespaces, also those not explicitly set through the extension false
$wgPagePropertiesDisableVersionCheck disable version check of the extension false

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


Maintenance

If PageProperties prior to 1.5.0 was installed on your wiki, please run

php extensions/PageProperties/maintenance/migrateSlots.php --remove-slot

to migrate slot contents to dedicated tables.


If you are also using Extension:VisualData, run the latter command without the option remove-slot

php extensions/PageProperties/maintenance/migrateSlots.php 

and then run:

php extensions/VisualData/maintenance/RebuildData.php

(this will rename the pageproperties slot role to jsondata slot role)


Roadmap

  • rewrite dynamictable following OO model

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.

For professional support please write at the email address posted User:Thomas-topway-it

See also

  1. JavaScript Object Notation for Linked Data (JSON-LD)
  2. Search Engine Optimisation (SEO)

Test it out!