SourceWatch:Templates

How to use templates: general
A template is called by using two curly brackets like this:

Using variables
Templates generally utilize inputs in a call, either through variables named in the template or through variables that are simply set in a predefined order. Inputs for variables are separated by "pipes". (This: | is a pipe.) The guides below detail how the variables are set up for each of the templates used on SourceWatch.

If a template uses named variables, you must define the variables in the call, separated by pipes:

If a template uses ordered variables, you simply enter the inputs in the correct order:

In either case, you can put the template call all in one line (as above) or use multiple lines like this:

and
Sometimes it is useful to include text or code in a template that applies only to pages the template is used on but is not applied to the template page itself. To do this, include a " " tag at the beginning of that content and a " " tag at the end. You would use this, for example, if you included a category tag in the template because you wanted every article with that template to show up in that category but you don't want the template page itself showing up in the category.

For example, Template:Stub uses this to put every page it is applied to (by adding " " to the page) in the Category:Stub while not putting the Template:Stub page in the category as well.

The inverse of that tag is the " " tag. This is used to put content on the template page that will not be fed into pages where the template is applied. To do this, include a " " tag at the beginning of that content and a " " tag at the end. You would use this, for example, if you wanted to include instructions or notes related to the template on the template's page without having those notes show up on the pages the template is applied to.

For example, Template:Main contains instructions on how to use it but uses the " " tag to keep those instructions from showing up on every page the template is used on.

Links to main articles
A convenient and eye-catching way to link to a larger SourceWatch article on a topic is to use the "Main article" template. You input this:

Here's a real example:

Link to the template: Template:Main article

Types of templates used on SourceWatch

 * Category:Meta templates
 * Category:Congresspedia-specific templates