Requests for comment/Accessing page properties from wiki pages

This is a request for comments regarding accessing page properties from wiki pages.

Background
MediaWiki has a page_props database table where certain attributes and values are stored on a per-page basis. For example:

MediaWiki stores whether a page is a disambiguation page, what its default category sort key is, and what its page image is, each being determined by different means:,  , and a heuristic (cf. Extension:PageImages).

Problem
Users cannot access a page's properties from other local wiki pages.

Potential use-cases:


 * T71441: Feature request: add detection for disambiguation pages to Scribunto
 * T131911: Allow retrieving/getting page image file name from wikitext using Scribunto/Lua or parser function or something
 * T154346: Provide "wikitext" means of accessing arbitrary wiki page's default category sort key

Complications
This makes wikitext more volatile. We already have features such as  and , which can be combined in weird and potentially abusive ways. For example:.

If we added the ability to get page properties, we could end up with cases such as these:



Option 1
Modify Scribunto/Lua to expose these properties as functions or Title object attributes.

Option 2
Add parser functions to MediaWiki core or to extensions such as PageImages. For example:



Option 3
For two of the use-cases, the focus is talk pages. So we could add:



But this is kind of obnoxious and it boxes us in a bit. We may want to break out of the subject space page–talk page binary at some point, supporting groupings of three or four or more pages. On a related point, we may want to use this functionality on non-talk pages, which is the case for properties such as page images.

Option 4
Do nothing. Don't allow access to these page properties. :-(