Template:Template parameter value
| This template is used on approximately 50,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This template uses Lua: |
The purpose of this template is to gain the value of a template's parameter (named or numbered) in an article, for usage elsewhere. For example, gaining the value of the |num_episodes= parameter in the {{Infobox television}} template in an article, to use in another article.
This template works with named or numbered parameters; i.e. it can get the first parameter of {{Start date}} (the year). This template is case-sensitive; i.e. setting |Viewers= will not match |viewers=. Make sure that you are listing the article where the template exists, not where it's transcluded to.
Usage
{{Template parameter value|article|template|template count|parameter|parameter count}}
Examples
24th usage of |OriginalAirDate= in the 3rd usage of {{Episode table}} in List of Lucifer episodes:
{{Template parameter value|List of Lucifer episodes|Episode table|3|OriginalAirDate|24}}→ May 14, 2018
2nd usage of |archive-url= in the 1st usage of {{Series overview}} in List of Agents of S.H.I.E.L.D. episodes:
{{Template parameter value|List of Agents of S.H.I.E.L.D. episodes|Series overview||archive-url|2}}→ https://web.archive.org/web/20150523083530/http://deadline.com/2015/05/2014-15-full-tv-season-ratings-shows-rankings-1201431167/
1st usage of |LineColor= in the 2nd usage of {{Episode list/sublist}} in Vikings season 4:
{{Template parameter value|Vikings season 4|Episode list/sublist|2|LineColor}}→ 3A3634
1st usage of |num_episodes= in the 1st usage of {{Infobox television}} in 12 Monkeys (TV series):
{{Template parameter value|12 Monkeys (TV series)|Infobox television||num_episodes}}→ 47
3rd parameter in the 8th usage of {{Start date}} in The Big Bang Theory:
{{Template parameter value|The Big Bang Theory|Start date|8|3}}→ 26
1st parameter in the last usage of {{date table sorting}} in List of Falcon 9 and Falcon Heavy launches:
{{Template parameter value|List of Falcon 9 and Falcon Heavy launches|date table sorting|-1|1}}→ June 4, 2026
TemplateData
A template to grab the value of parameters from templates on a page
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page | 1 | The page to grab templates from | Page name | required |
| Template | 2 | The template to look for in the target page | String | required |
| Template index | 3 | Which occurrence of the template to check for parameters in. Set to -1 for last occurrence (other negative numbers not supported). | Number | optional |
| Parameter | 4 | The name of the parameter to check for | String | required |
| Parameter index | 5 | Which occurrence of the parameter to check for in the template. Does not apply if "Ignore subtemplates" is used | Number | optional |
| Ignore subtemplates | ignore_subtemplates ist | Giving this a value will make the template ignores subtemplates and their parameters when looking for a value in a template. Can be used for more precise grabbing of parameters as opposed to using a parameter index
| Boolean | optional |
| Ignore blank values | ignore_blank | Ignores keys with blank values when deciding which index of a parameter to use. This option does nothing when using ignore_subtemplates
| Boolean | optional |
| Only subtemplates | only_subtemplates | The inverse to ignore_subtemplates. Only keys that are in subtemplates of the template requested will be considered. ignore_subtemplates will take precedence over this option if both are enabled
| Boolean | optional |
| Don't process | dontprocess | If enabled, the returning result won't be processed into wikitext, and will be returned as raw data.
| Boolean | optional |
| Treat as regex | treat_as_regex | Treats the Templates input as a lua regex instead of a raw string
| Boolean | optional |
See also
- {{get parameter}}, another template doing the same thing with a different set of limitations
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.