Acciones

Plantilla

Diferencia entre revisiones de «Template parameter value/doc»

De La Venciclopedia

m (1 revisión importada)
mSin resumen de edición
 
(No se muestra una edición intermedia del mismo usuario)
Línea 1: Línea 1:
{{Documentation subpage}}
{{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]]) -->


== Usage ==
== Uso ==
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 {{para|num_episodes}} parameter in the {{tl|Infobox television}} template in an article, to use in another article.
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.


This template works with named or numbered parameters; i.e. it can get the first parameter of {{tl|Start date}} (the year). This template is case-sensitive; i.e. setting {{para|Viewers}} will not match {{para|viewers}}. Make sure that you are listing the article where the template exists, not where it's transcluded to.
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.


=== Basic Syntax ===
=== Basic Syntax ===
: <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>


=== Examples ===
=== 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 40: Línea 40:
"1": {
"1": {
"label": "Page",
"label": "Page",
"description": "The page to grab templates from",
"description": "La página para obtener plantillas",
"type": "wiki-page-name",
"type": "wiki-page-name",
"required": true
"required": true
Línea 46: Línea 46:
"2": {
"2": {
"label": "Templates",
"label": "Templates",
"description": "The templates to look for in the target page. Can be provided in a comma split list to check for multiple templates",
"description": "Las plantillas a buscar en la página de destino. Se puede proporcionar en una lista dividida por comas para buscar varias plantillas",
"type": "string",
"type": "string",
"required": true
"required": true
Línea 52: Línea 52:
"3": {
"3": {
"label": "Template index",
"label": "Template index",
"description": "Which occurence of the template to check for parameters in",
"description": "¿En qué aparición de la plantilla se deben verificar los parámetros?",
"type": "number"
"type": "number"
},
},
"4": {
"4": {
"label": "Parameter",
"label": "Parameter",
"description": "The name of the parameter to check for",
"description": "El nombre del parámetro a comprobar.",
"type": "string",
"type": "string",
"required": true
"required": true
Línea 63: Línea 63:
"5": {
"5": {
"label": "Parameter index",
"label": "Parameter index",
"description": "Which occurence of the parameter to check for in the template. Does not apply if \"Ignore subtemplates\" is used",
"description": "Qué ocurrencia del parámetro verificar en la plantilla. No se aplica si se utiliza \"Ignorar subplantillas\"",
"type": "number"
"type": "number"
},
},
Línea 71: Línea 71:
],
],
"label": "Ignore subtemplates",
"label": "Ignore subtemplates",
"description": "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",
"description": "Darle un valor a esto hará que la plantilla ignore las subplantillas y sus parámetros cuando busque un valor en una plantilla. Se puede utilizar para capturar parámetros con mayor precisión en lugar de utilizar un índice de parámetros.",
"type": "boolean",
"type": "boolean",
"default": "no"
"default": "no"
Línea 77: Línea 77:
"ignore_blank": {
"ignore_blank": {
"label": "Ignore blank values",
"label": "Ignore blank values",
"description": "Ignores keys with blank values when deciding which index of a parameter to use. This option does nothing when using ignore_subtemplates",
"description": "Ignora las claves con valores en blanco al decidir qué índice de un parámetro usar. Esta opción no hace nada cuando se usa ignore_subtemplates",
"type": "boolean",
"type": "boolean",
"default": "no"
"default": "no"
Línea 83: Línea 83:
"only_subtemplates": {
"only_subtemplates": {
"label": "Only subtemplates",
"label": "Only subtemplates",
"description": "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",
"description": "Lo inverso a ignore_subtemplates. Sólo se considerarán claves que se encuentren en subplantillas de la plantilla solicitada. ignore_subtemplates tendrá prioridad sobre esta opción si ambas están habilitadas",
"type": "boolean",
"type": "boolean",
"default": "no"
"default": "no"
Línea 89: Línea 89:
"dontprocess": {
"dontprocess": {
"label": "Don't process",
"label": "Don't process",
"description": "If enabled, the returning result won't be processed into wikitext, and will be returned as raw data.",
"description": "Si está habilitado, el resultado devuelto no se procesará en wikitexto y se devolverá como datos sin procesar..",
"type": "boolean",
"type": "boolean",
"default": "no"
"default": "no"
Línea 95: Línea 95:
"treat_as_regex": {
"treat_as_regex": {
"label": "Treat as regex",
"label": "Treat as regex",
"description": "Treats the Templates input as a lua regex instead of a raw string",
"description": "Trata la entrada de Plantillas como una expresión regular lua en lugar de una cadena sin formato",
"type": "boolean",
"type": "boolean",
"default": "no"
"default": "no"
}
}
},
},
"description": "A template to grab the value of parameters from templates on a page",
"description": "Una plantilla para obtener el valor de los parámetros de las plantillas en una página.",
"format": "inline",
"format": "inline",
"paramOrder": [
"paramOrder": [
Línea 114: Línea 114:
"treat_as_regex"
"treat_as_regex"
]
]
}</templatedata>
}</templatedata><includeonly><!-- Categories below this line, please; interwikis at Wikidata --></includeonly>
 
== See also ==
* {{tl|get parameter}}, another template doing the same thing with a different set of limitations
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
}}</includeonly>

Revisión actual - 19:44 21 ene 2024

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.

Basic Syntax

{{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 (2018-05-14)
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

Una plantilla para obtener el valor de los parámetros de las plantillas en una página.

Parámetros de la plantilla

Es preferible escribir los parámetros en una sola línea.

ParámetroDescripciónTipoEstado
Page1

La página para obtener plantillas

Nombre de páginaobligatorio
Templates2

Las plantillas a buscar en la página de destino. Se puede proporcionar en una lista dividida por comas para buscar varias plantillas

Cadenaobligatorio
Template index3

¿En qué aparición de la plantilla se deben verificar los parámetros?

Númeroopcional
Parameter4

El nombre del parámetro a comprobar.

Cadenaobligatorio
Parameter index5

Qué ocurrencia del parámetro verificar en la plantilla. No se aplica si se utiliza "Ignorar subplantillas"

Númeroopcional
Ignore subtemplatesignore_subtemplates ist

Darle un valor a esto hará que la plantilla ignore las subplantillas y sus parámetros cuando busque un valor en una plantilla. Se puede utilizar para capturar parámetros con mayor precisión en lugar de utilizar un índice de parámetros.

Predeterminado
no
Lógicoopcional
Ignore blank valuesignore_blank

Ignora las claves con valores en blanco al decidir qué índice de un parámetro usar. Esta opción no hace nada cuando se usa ignore_subtemplates

Predeterminado
no
Lógicoopcional
Only subtemplatesonly_subtemplates

Lo inverso a ignore_subtemplates. Sólo se considerarán claves que se encuentren en subplantillas de la plantilla solicitada. ignore_subtemplates tendrá prioridad sobre esta opción si ambas están habilitadas

Predeterminado
no
Lógicoopcional
Don't processdontprocess

Si está habilitado, el resultado devuelto no se procesará en wikitexto y se devolverá como datos sin procesar..

Predeterminado
no
Lógicoopcional
Treat as regextreat_as_regex

Trata la entrada de Plantillas como una expresión regular lua en lugar de una cadena sin formato

Predeterminado
no
Lógicoopcional