Page MenuHomePhabricator

{{BASEPAGENAME}} does not return topmost page name
Closed, ResolvedPublic


Author: emddudley

Currently {{BASEPAGENAME}} returns the parent page of the current page; it
essentially acts like [[../]]. For example, using {{BASEPAGENAME}} on
"Wikipedia:ExamplePage/Archive_1/Subpage" it returns "ExamplePage/Archive 1".

The current behavior is misleading. I expect {{BASEPAGENAME}} to get the topmost
name, not the immediate parent. When using {{BASEPAGENAME}} on
"Wikipedia:ExamplePage/Archive_1/Subpage" I think it should return "ExamplePage".

I propose modifying the current behavior of {{BASEPAGENAME}} (getBaseText() in
Title.php) to return the topmost name, as I believe this was the original intent
of bug 5845.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:19 PM
bzimport set Reference to bz6067.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

This was not the intended behaviour, and it doesn't make sense to give subpages
any more special treatment than they already have, especially since they mean
very little to MediaWiki as it is.

  • Bug 10136 has been marked as a duplicate of this bug. ***

robchur wrote:

Introduced TITLEPARTS parser function in r22711, to allow obtaining whatever number of segments of a page title the user desires.

fdcn64 wrote:

can do work as below?