Diferencia entre revisiones de «Template parameter value/doc»
De La Venciclopedia
m (1 revisión importada) |
mSin resumen de edición |
||
Línea 1: | Línea 1: | ||
{{ | {{subpágina de documentación}} | ||
{{Shortcut|Template:Tmpv}} | {{Shortcut|Template:Tmpv}} | ||
{{Lua|Module:Template parameter value}} | {{Lua|Module:Template parameter value}} | ||
Línea 5: | Línea 5: | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
== | == Uso == | ||
El propósito de esta plantilla es obtener el valor de un parámetro de plantilla (nombrado o numerado) en un artículo, para su uso en otros lugares. Por ejemplo, obtener el valor del parámetro {{para|num_episodes}} en la plantilla {{tl|Infobox television}} de un artículo, para usarlo en otro artículo. | |||
Esta plantilla funciona con parámetros nombrados o numerados, es decir, puede obtener el primer parámetro de {{tl|Fecha de inicio}} (el año). Esta plantilla distingue entre mayúsculas y minúsculas; es decir. la configuración {{para|Viewers}} no coincidirá con {{para|viewers}}. Asegúrese de incluir el artículo donde existe la plantilla, no donde está transcluida. | |||
=== | === Código básico === | ||
: <syntaxhighlight lang="wikitext" inline>{{Template parameter value|ARTICLE|TEMPLATE|TEMPLATE-COUNT|PARAMETER|PARAMETER-COUNT}}</syntaxhighlight> | : <syntaxhighlight lang="wikitext" inline>{{Template parameter value|ARTICLE|TEMPLATE|TEMPLATE-COUNT|PARAMETER|PARAMETER-COUNT}}</syntaxhighlight> | ||
=== | === Ejemplo === | ||
; 24th usage of |OriginalAirDate= in the 3rd usage of {<nowiki />{Episode table}} in [[List of Lucifer episodes]] | ; 24th usage of |OriginalAirDate= in the 3rd usage of {<nowiki />{Episode table}} in [[List of Lucifer episodes]] | ||
: <syntaxhighlight lang="wikitext" inline>{{Template parameter value|List of Lucifer episodes|Episode table|3|OriginalAirDate|24}}</syntaxhighlight> | : <syntaxhighlight lang="wikitext" inline>{{Template parameter value|List of Lucifer episodes|Episode table|3|OriginalAirDate|24}}</syntaxhighlight> | ||
Línea 114: | Línea 114: | ||
"treat_as_regex" | "treat_as_regex" | ||
] | ] | ||
}</templatedata> | }</templatedata><includeonly><!-- Categories below this line, please; interwikis at Wikidata --></includeonly> | ||
<includeonly> | |||
<!-- Categories below this line, please; interwikis at Wikidata --> | |||
Revisión del 19:37 21 ene 2024
This template uses Lua: |
Uso
El propósito de esta plantilla es obtener el valor de un parámetro de plantilla (nombrado o numerado) en un artículo, para su uso en otros lugares. Por ejemplo, obtener el valor del parámetro |num_episodes=
en la plantilla {{Infobox television}} de un artículo, para usarlo en otro artículo.
Esta plantilla funciona con parámetros nombrados o numerados, es decir, puede obtener el primer parámetro de {{Fecha de inicio}} (el año). Esta plantilla distingue entre mayúsculas y minúsculas; es decir. la configuración |Viewers=
no coincidirá con |viewers=
. Asegúrese de incluir el artículo donde existe la plantilla, no donde está transcluida.
Código básico
{{Template parameter value|ARTICLE|TEMPLATE|TEMPLATE-COUNT|PARAMETER|PARAMETER-COUNT}}
Ejemplo
- 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}}
- mayo 14, 2018
- 2nd usage of |archiveurl= 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
Template data
A template to grab the value of parameters from templates on a page
Parámetro | Descripción | Tipo | Estado | |
---|---|---|---|---|
Page | 1 | The page to grab templates from | Nombre de página | obligatorio |
Templates | 2 | The templates to look for in the target page. Can be provided in a comma split list to check for multiple templates | Cadena | obligatorio |
Template index | 3 | Which occurence of the template to check for parameters in | Número | opcional |
Parameter | 4 | The name of the parameter to check for | Cadena | obligatorio |
Parameter index | 5 | Which occurence of the parameter to check for in the template. Does not apply if "Ignore subtemplates" is used | Número | opcional |
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
| Lógico | opcional |
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
| Lógico | opcional |
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
| Lógico | opcional |
Don't process | dontprocess | If enabled, the returning result won't be processed into wikitext, and will be returned as raw data.
| Lógico | opcional |
Treat as regex | treat_as_regex | Treats the Templates input as a lua regex instead of a raw string
| Lógico | opcional |