-
Notifications
You must be signed in to change notification settings - Fork 1
Parser Functions
lethosor edited this page Nov 10, 2014
·
2 revisions
This extension can be enabled or disabled on a page with the {{#nlenable}}
function:
{{#nlenable:1}} <!-- enables extension -->
{{#nlenable:0}} <!-- disables extension -->
Notes:
- The following values are treated as "False"
n
no
false
-
0
(numeral zero) - Values are not case-sensitive
- Later calls to this function will override earlier calls. There is currently no checking in place to prevent this.
- All calls to this function will be evaluated before any links are parsed, due to the order that the MediaWiki hooks are executed. It is not possible to enable or disable this extension for only a section of a page (or a transcluded page).
The {{#nlenabled}}
function indicates whether or not the extension is enabled. It takes two optional arguments:
- The value to return when the extension is enabled (defaults to
1
) - The value to return when the extension is disabled (defaults to empty string)
Code | Output when enabled | Output when disabled |
---|---|---|
{{#nlenabled:}} | 1 | |
{{#nlenabled:yes}} | yes | |
{{#nlenabled:yes|}} | yes | |
{{#nlenabled:yes|no}} | yes | no |
{{#nlenabled:|}} | ||
{{#nlenabled:|no}} | no |