Module:Caller title/doc: Difference between revisions
From Neodyland Wiki
More actions
←Created page with 'This module simply returns the title of the page embedding the template that directly calls this module (i.e. the page that embeds the wrapper template). It’s...' |
describe how it really works |
||
| Line 1: | Line 1: | ||
This module simply returns the title of the page | This module simply returns the title of the page calling this module. It’s intended for templates translated using the [[Help:Autotranslate#Using Extension:Translate|Translate extension]]. It has two entry points, both can be called with <code><nowiki>{{#invoke:Caller title|</nowiki><var>entry point name</var>}}</code>: | ||
;title: Get the full title of the template. | ;title: Get the full title of the template. | ||
;lang: Get the language code (subpage name). In fact, it doesn’t check if the subpage name is a valid language code, so if called from ''X/y/z,'' it’ll happily return ''z.'' The template using this functionality should ensure it’s only used on language subpages (or be okay with garbage output). | ;lang: Get the language code (subpage name). In fact, it doesn’t check if the subpage name is a valid language code, so if called from ''X/y/z,'' it’ll happily return ''z.'' The template using this functionality should ensure it’s only used on language subpages (or be okay with garbage output). | ||
<includeonly> | <includeonly> | ||
[[Category:Internationalization templates]]</includeonly> | [[Category:Internationalization templates]]</includeonly> | ||
Revision as of 16:31, 11 October 2019
This module simply returns the title of the page calling this module. It’s intended for templates translated using the Translate extension. It has two entry points, both can be called with {{#invoke:Caller title|entry point name}}:
- title
- Get the full title of the template.
- lang
- Get the language code (subpage name). In fact, it doesn’t check if the subpage name is a valid language code, so if called from X/y/z, it’ll happily return z. The template using this functionality should ensure it’s only used on language subpages (or be okay with garbage output).