Currently special pages render a single "Special" tab. This appears in all skins, but position varies based on skin.
Going forward to support the work in T286466 we would like to add SpecialPage::getSubpages. This method returns an array of sub pages that can be rendered by the skin in the UI. It works similar to getSubpagesForPrefixSearch but will usually be a subset of the pages returned by getSubpagesForPrefixSearch and in many cases will be an empty list.
Specification
- The feature is opt in. Skins like Vector can continue to work as before
- A new method SpecialPage::getRelatedNavigationLinks will be added to describe tabs. A page with no sub page will be described by an empty string. eg. return ['Special:Watchlist', 'Special:Watchlist/raw']; on Special:Watchlist would generate two tabs - one link to Special:Watchlist and one to Special:Watchlist/raw. An empty array will mean no tabs should be rendered. By default, the return value will be empty (e.g. no tabs)
- A new method SpecialPage::getShortDescription will be added - this will allow special pages to define a label to describe the page that will be rendered as the text of the associated tab. By default it will use subpagetab-<special page name>-<subpage>. For example Special:Watchlist/raw would be described by subpagetab-watchlist-raw. It will be stable to override this to change the label.
- A new menu will be made available to skins in Skin:: buildContentNavigationUrlsInternal called "associatedPages". This can be used instead of the existing namespace key, but also contain definitions for subpages. This ensures the change is backwards compatible.
Sign off steps
- It's important at least one of the special pages in core use this feature. We're targetting the Special:Contributions page as the first consumer (see T286466)