Page MenuHomePhabricator

More flexible determination of what is a sub-page
Closed, DeclinedPublic

Description

Author: qleah

Description:
On the occasions where it is useful to have subpages of main namespace articles,
it is awkward to have no effective builtin navigation.


Version: unspecified
Severity: enhancement

Details

Reference
bz3455

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 8:50 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz3455.
bzimport added a subscriber: Unknown Object (MLST).

Subpages are disabled by default in the main namespace
due to the annoyance of false "subpages" on articles
with slashes in their actual names on MediaWiki's
typical usage (that is, encyclopedias).

So pages with a slash in them have no special meaning
in the main namespace unless you've enabled them there.
You can change this for your site; see DefaultSettings.php
for the default state and details of all configurable
settings.

For more background see:
http://meta.wikimedia.org/wiki/MediaWiki_FAQ#How_do_I_organize_pages_into_subdirectories_like_.2Fwiki.2Fsubdir.2FPageName_.3F
http://meta.wikimedia.org/wiki/Help:Link#Subpage_feature

qleah wrote:

Could a feature be added, then, to override the default behavior per-page? It
would be useful to be able to force subpage behavior with a SUBPAGE
directive, or the opposite with NOSUBPAGE (by the way, how does Mediawiki
handle talk pages of main namespace articles with slashes in their titles?)
Could subpages be detected by heuristic, for example by checking whether the
parent exists and contains a link to the subpage?

rowan.collins wrote:

(In reply to comment #2)

Could a feature be added, then, to override the default behavior per-page? It
would be useful to be able to force subpage behavior with a SUBPAGE
directive, or the opposite with NOSUBPAGE

Why override it per page? Either you want sub-pages to be allowed (in which case
you can use them by having a slash in the title, or avoid them by not) or you
don't.

(by the way, how does Mediawiki
handle talk pages of main namespace articles with slashes in their titles?)

Those are in the Talk: namespace, which has sub-pages enabled by default; so a
talk page with a slash in will be interpretted as a sub-page, even if it isn't
intended that way. This rarely happens, and isn't exactly a big deal when it does.

Could subpages be detected by heuristic, for example by checking whether the
parent exists and contains a link to the subpage?

Well, currently, I believe, the link shows up if the title has a slash in, and
the "parent" exists. You could hack things up to hide the link if the parent
page didn't link to the child if you really wanted though - just query the
'links' table appropriately.

Really, the special consideration the software gives to sub-pages is so minimal
that anything more complex than what currently exists seems a waste of effort to me.

Marking as WONTFIX per comment #3