Help:Parser functions in templates/es

Cuando aplicamos una ParserFunctions a un parámetro de un Template, podemos usar un símbolo de barra ("|") para incluir un valor vacío como valor determinado, de esta manera indicar cómo manejar las cosas si un parámetro está o no incluido. Used in an #if parser function, the unexpanded text from the undefined parameter will evaluate as true, which may be an unexpected result.




 * Ejemplo A:  


 * Resultado: 




 * Ejemplo B:  


 * Result: 

El segundo uso ( , ejemplo B) se usa cuando el contenido es por determinado vacío. Es a menudo una forma de manejar situaciones donde un parámetro existe, pero está ocupado solo por espacios vacíos.

Probando y pasando parámetros indefinidos
To distinguish a possibly empty parameter from an unspecified, one, compare it to itself using  and different defaults. What the defaults are does not matter as long as they are different, so they are typically chosen to be short. The following all work equivalently:



In rare cases, a template behaves differently when a parameter is unspecified compared to when it is specified but empty. When this template is used by a wrapper template (which uses the same set of named parameters), one way to ensure undefined parameters remain undefined is as follows (the technique also works with numbered parameters):





receives a defined normal_parameter in all cases. When normal_parameter is defined but empty and when it is undefined,  receives an empty normal_parameter.

By contrast, the  receives a defined sensitive_parameter only when it is indeed defined; when sensitive_parameter is undefined, the   changes the parameter name to sensitive_parameterNULL. The suffixed parameter name must be meaningless to the  for this to work properly.

Véase también

 * Extension:Loops#forargs
 * Extension:Loops#forargs
 * Extension:Loops#forargs