Search results
Results from the WOW.Com Content Network
Using a template is similar to calling a function in programming. When called, it returns a value. For a template, calling is known as a template call and the return value is known as the expansion of the template, which is treated as part of the calling page's source. Like functions, some templates can take parameters that affect their output.
The wrappers option is used to specify a limited number of templates as wrapper templates, that is, templates whose only purpose is to call a module. If the module detects that it is being called from a wrapper template, it will only check for arguments in the parent frame; otherwise it will only check for arguments in the frame passed to getArgs.
The function of Template:Exams is to place a box on one's userpage stating that one is taking a wikibreak to focus on exams. A more general template for wikibreaks, Template:Wikibreak, already exists, so rather than duplicating it, {{}} just consists of a call of {{}} with some parameters specified, such as an image of books rather than the default image of a sunset.
name – the name of the template (string, required). This should be exactly as it will appear in the invocation, e.g. for Template:Example use "Example". To generate the template name from a page name, you can use the name function. args – the arguments to use in the invocation (table, required). Table keys and values must be either strings ...
} extracts a specified template's parameters and performs a variety of tasks to aid in its documentation or WP:TFD merge nominations. It itself takes two parameters: |1=, the output format; and |base=, the title of a template. The compare function requires a third parameter, |other=. {} must always be substituted. Its usage is demonstrated below.
This module is for a very particular set of circumstances: when a substituted template needs to dynamically generate the wikimarkup for a template call, forwarding all numbered parameters. It also allows for the option of designating a prefix for a series of named parameters which will be converted to numbered ones.
Functions can be defined inside code blocks, permitting a run-time decision as to whether or not a function should be defined. There is no concept of local functions. Function calls must use parentheses with the exception of zero argument class constructor functions called with the PHP new operator, where parentheses are optional.
Templates on Wikipedia can be used for a variety of purposes. Some common uses for templates include infoboxes to summarize the information presented in an article, while others are information messages.