Page MenuHomePhabricator

Implement THIS and CALLER in core
Open, Needs TriagePublic

Description

From Extension:Parser_Fun:

The extension implements THIS: as a prefix for site information related magic words. With PAGENAME for example it can be used as {{THIS:PAGENAME}}. This allows to get the information from the page the phrase actually is literally defined on instead of the page which is being parsed and where the phrase was expanded into.
{{CALLER}} is a variable and parser function. This basically is a template call-stack accessors. Used within a template which is included in a page, this will return the name of the page which has included the template where {{CALLER}} is defined at. It is also possible to return the caller of the caller or a even more distant caller by giving an explicit index like {{CALLER:2}}. {{CALLER:0}} on the other hand would return the same as {{THIS}} would return.

Implementing this functionality in core should facilitate the simplification of much code that is intended to control the depth of the effects of templates and inclusion thereof, reduce some of the complexity of the safesubst usecases, help with transcendental categorisation, and other use cases.

Event Timeline

ahmad created this task.Sep 19 2018, 5:55 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 19 2018, 5:55 PM
Aklapper renamed this task from Implement THIS and CALER to Implement THIS and CALLER.Sep 19 2018, 5:56 PM
Aklapper added a project: MediaWiki-Parser.
ahmad renamed this task from Implement THIS and CALLER to Implement THIS and CALLER in core.Feb 26 2019, 9:17 PM
ahmad updated the task description. (Show Details)