Page MenuHomePhabricator

Add variable to show the topmost level in the tree of subpages
Closed, ResolvedPublic

Description

Author: misza

Description:
Please create an equivalent of {{BASEPAGENAME}} that cuts not only the last level of a page's name but all the way up to the "ground" level.

For example, on page [[User talk:Example/Archives/2008/January]]:

  • {{BASEPAGENAME}} returns "Example/Archives/2008"
  • proposed {{REALBASEPAGENAME}} (or whatever you name it) returns just "Example"

(Don't forget the URL-friendly {{REALBASEPAGENAMEE}}.)


Version: unspecified
Severity: enhancement

Details

Reference
bz12872

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:03 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz12872.
bzimport added a subscriber: Unknown Object (MLST).

misza wrote:

Implemented in r30413.

Unfortunately reverted in r30547.

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

londenp wrote:

Thanks for that solution with titleparts: that works. I have added this to http://meta.wikimedia.org/wiki/Help:Link/a/b

fantasy wrote:

{{ROOTPAGENAME}} would be great! Please?

Is a {{ROOTPAGENAME}} still necessary if #titleparts does this?

Would be easier to remember {{ROOTPAGENAME}}...

Ok, how about we restore r30413 but without the extra PARENTPAGENAME alias?

misza wrote:

How about we add ParserFunctions to core? ;)

Any chance of getting this one done? ;P

Seeing as its quite easy

fantasy wrote:

You mean that this still hasn't been added yet? :O

There is a template on Wikipedia that could use {{ROOTPAGENAME}}, so please do this.

Titleparts has been available for how long now, what is the problem?

I suspect the bug being open/people not knowing about it...

For peoples info...

http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23titleparts:

So, its whether people accept that as a solution (fine if the wiki has parser functions), or if something should still go in core...

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

See also:

  • [[Extension:BookManager#Variables]]
    • {{ROOTPAGENAME}}
    • {{ROOTPAGENAMEE}}
  • [[Template:ROOTPAGENAME]]

(In reply to comment #17)

  • [[Extension:BookManager#Variables]]

Uops... I mean [[mw:Extension:BookManager#Variables]].

Danny_B claimed this task.

{{ROOTPAGENAME}} works nowadays.