Extension:PageProperties

Category:Extensions without an imageCategory:GPL licensed extensions
MediaWiki extensions manual
PageProperties
Release status: stableCategory:Stable extensions
Implementation Hook Category:Hook extensions, Special page Category:Special page extensions
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.Category:Extensions with master compatibility policy
MediaWiki >= 1.35.0Category:Extensions with manual MediaWiki version
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
  • $wgPagePropertiesDisplayAlwaysUnprefixedTitles
  • $wgPagePropertiesAddTrackingCategory
  • $wgPagePropertiesDisableNavigationLink
  • $wgPagePropertiesDisableVersionCheck
  • $wgPagePropertiesDisableSidebarLink
  • pageproperties-caneditpageproperties
Quarterly downloads 6 (Ranked 89th)
Translate the PageProperties extension if it is available at translatewiki.net
Category:All extensions

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/run.php update (this will install the required tables)
  • follow the instructions to migrate from previous versions of PageProperties if applicable
  • Yes 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, bureaucratYes  
pageproperties-adminYes  
pageproperties-editorYes  

Global parameters

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

(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 maintenance/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 maintenance/run.php ./extensions/PageProperties/maintenance/migrateSlots.php 

and then run:

php maintenance/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!

Category:Page metadata extensions Category:Menu extensions Category:Search engine optimization extensions
Category:All extensions Category:ArticleUndelete extensions Category:BeforeInitialize extensions Category:BeforePageDisplay extensions Category:Extensions in Wikimedia version control Category:Extensions included in WikiForge Category:Extensions with manual MediaWiki version Category:Extensions with master compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:Hook extensions Category:LinkerMakeExternalLink extensions Category:LoadExtensionSchemaUpdates extensions Category:Menu extensions Category:MultiContentSave extensions Category:OutputPageParserOutput extensions Category:PageDeleteComplete extensions Category:Page metadata extensions Category:ParserAfterTidy extensions Category:Search engine optimization extensions Category:SidebarBeforeOutput extensions Category:SkinTemplateNavigation::Universal extensions Category:Special page extensions Category:Stable extensions