Addition of PPFrame::getTitle
Closed, ResolvedPublic

Assigned To
None
Priority
Needs Triage
Author
bzimport
Subscribers
wikibugs-l
Projects
Reference
bz31995
Description

Author: van.de.bugger

Description:
Let us make frame title available through method getTitle. It allows parser functions to access title of current frame. It makes possible magic words or parser functions which know the name of current frame, like {{SRCNAME}} (discussed in 24284). In turn, {{SRCNAME}} makes possible "template-scope" variables, e. g. {{ #vardefine: {{SRCNAME}}:i }}, {{ #var: {{SRCNAME}}:i }}. It also makes possible extensions which does the same even more gracefully: {{ #localdefine: i }}, {{ #local: i }}. (localdefine, local are parser function which set/get "template-scope" variables; I wrote "template-scope" in parentheses because these variables are available outside by using "full" name: {{ #var: Templatename:i }}.)


Version: unspecified
Severity: enhancement

bzimport added a project: MediaWiki-Parser.Via ConduitNov 21 2014, 11:57 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz31995.
bzimport created this task.Via LegacyOct 27 2011, 6:47 PM
bzimport added a comment.Via ConduitOct 27 2011, 6:48 PM

van.de.bugger wrote:

Trivial getTitle implementation.

Attached: MediaWiki-parser-getTitle.patch

bzimport added a comment.Via ConduitNov 9 2011, 8:46 PM

sumanah wrote:

Adding the "need-review" and "patch" keywords, for patches that need review by developers. Van de Bugger, thank you for your patch.

Reedy added a comment.Via ConduitNov 9 2011, 8:53 PM

Reviewed, and applied in r102571

Also did Preprocessor_HipHop as it exists in trunk (and 1.18?)

Technically wasn't needed, because $title is var (so public), but certainly the better way to do it than direct member variable access!

Thanks

bzimport added a comment.Via ConduitNov 12 2011, 10:29 AM

van.de.bugger wrote:

Verified on r102853.

bzimport added a comment.Via ConduitDec 6 2011, 7:23 PM

daniel.a.r.werner wrote:

Great, it once took me a while to get the idea that there was a public $mTitle. For additions like this I would really appreciate to see the '@since' in the function documentation. Would make it a lot easier to keep backwards compatibility in extensions.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.