Template:Get globals
From Historical Hastings
- Purpose
- Passed as a parameter into large templates such as {{showfacts person}} or {{showfacts children}}, this function loads properties (possibly laboriously calculated) from the /sensor subpage into a global variables string array whose elements may be accessed with an #explode call. Preloading all values once into a global array reduces SMW calls, thereby increasing performance.
- Parameters
- None
- Returns
- A string array delimited within the special character sequence" ₧₯<variable name>::<value>₯₧ " Values are delimited, but #show returns them. Example:
- ₧₯age at death::39₯₧₧₯hint_tabs::tree,ancestors....
- Accessing the array; examples
| Test if values exist: | {{#pos:{{{globals|}}}|₧₯hint_tabs::}} |
|---|---|
| list of values | {{#explode:{{#explode:{{{globals|}}}|₧₯hint_tabs::|1}}|₯₧|0}} |
- Internals
- Subroutine /make list takes a single array member enumeration parameter:
- list: itemizes the properties returned by the function. First element is unused.
| The above documentation is transcluded from Template:Get globals/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |