Help:Templates: Difference between revisions
(formatting) |
(fmt) |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Templates are standard bits of text, links, or formatting that can be applied to a page. | Templates are standard bits of text, links, or formatting that can be applied to a page. | ||
==Basic usage== | |||
Templates are applied to a page by adding the text '''<nowiki>{{TemplateName}}</nowiki>''' to the desired page. Whatever text is on the template page at <nowiki>Template:TemplateName</nowiki> will then be ''[http://en.wikipedia.org/wiki/Wikipedia:Transclusion transcluded]'' onto the page -- included by reference. This permits inclusion of the same standard text on multiple pages, and simple editing of that text in one place without inconsistent versions everywhere. Disadvantages include an increase in server processing load and consistent replication of fucked-up versions. | Templates are applied to a page by adding the text '''<nowiki>{{TemplateName}}</nowiki>''' to the desired page. Whatever text is on the template page at <nowiki>Template:TemplateName</nowiki> will then be ''[http://en.wikipedia.org/wiki/Wikipedia:Transclusion transcluded]'' onto the page -- included by reference. This permits inclusion of the same standard text on multiple pages, and simple editing of that text in one place without inconsistent versions everywhere. Disadvantages include an increase in server processing load and consistent replication of fucked-up versions. | ||
| Line 7: | Line 8: | ||
However, you should probably ''not'' edit unless you're familiar with template syntax. | However, you should probably ''not'' edit unless you're familiar with template syntax. | ||
Useful syntax includes: | ==Useful syntax includes:== | ||
; The "noinclude" tag. | ; The "noinclude" tag. | ||
: The "noinclude" tag basically takes whatever text is included on that template page and uses it ''only'' on the template page, and does ''not'' transclude it to other pages. Use it for things like including "usage" instructions on the template page. Another use would be to add categories that help organize the template itself, such as [[:Category:Navigational templates]]; those categories should not be transcluded onto the content page. Example of usage on a template page: | : The "noinclude" tag basically takes whatever text is included on that template page and uses it ''only'' on the template page, and does ''not'' transclude it to other pages. Use it for things like including "usage" instructions on the template page. Another use would be to add categories that help organize the template itself, such as [[:Category:Navigational templates]]; those categories should not be transcluded onto the content page. Example of usage on a template page: | ||
:: <nowiki><noinclude> | :: <nowiki><noinclude></nowiki> | ||
::: Apply this template by typing {{PrevNext}}. | :::<nowiki> Apply this template by typing {{PrevNext}}. </nowiki> | ||
::: [[Category:Navigational templates]]</ | :::<nowiki> [[Category:Navigational templates]]</nowiki> | ||
:: </nowiki> | :: <nowiki></noinclude></nowiki> | ||
; The "includeonly" tag. | ; The "includeonly" tag. | ||
: The "includeonly" tag is the opposite of the "noinclude" tag. It takes whatever is included within the "includeonly" tags and only applies them to the transcluded text. It is particularly useful for applying a standard set of categories to the ''content'' page that shouldn't be on the ''template'' page. For instance, you might apply the <nowiki>{{feminisms}}</nowiki> template to a page, which asks for more varieties of feminist perspectives to be added to the page, and adds the [[:Category:More feminisms please]] to the page. That category is useful for people looking through the [[:Category:FSFwiki maintenance categories]] for work to do, but it doesn't belong on the template page itself. Example of usage on a template page: | : The "includeonly" tag is the opposite of the "noinclude" tag. It takes whatever is included within the "includeonly" tags and only applies them to the transcluded text. It is particularly useful for applying a standard set of categories to the ''content'' page that shouldn't be on the ''template'' page. For instance, you might apply the <nowiki>{{feminisms}}</nowiki> template to a page, which asks for more varieties of feminist perspectives to be added to the page, and adds the [[:Category:More feminisms please]] to the page. That category is useful for people looking through the [[:Category:FSFwiki maintenance categories]] for work to do, but it doesn't belong on the template page itself. Example of usage on a template page: | ||
:: <nowiki><includeonly> | :: <nowiki><includeonly></nowiki> | ||
::: Please add other feminist perspectives to this page. | ::: <nowiki>Please add other feminist perspectives to this page. </nowiki> | ||
::: [[Category:More feminisms please]] | ::: <nowiki>[[Category:More feminisms please]]</nowiki> | ||
:: </includeonly></nowiki> | :: <nowiki></includeonly></nowiki> | ||
[[Category:FSFwiki help]] | ==Further reading== | ||
* [http://meta.wikimedia.org/wiki/ParserFunctions ParserFunctions at MediaWiki] | |||
* [http://meta.wikimedia.org/wiki/Help:Parameter_default Parameter default] at MediaWiki | |||
* [http://en.wikipedia.org/wiki/Help:Templates Help:Templates] at Wikipedia | |||
* [http://en.wikipedia.org/wiki/Help:Advanced_templates Help:Advanced templates] at Wikipedia | |||
* [http://home.comcast.net/~gerisch/MediaWikiTemplates.html What you need to know to get started with MediaWiki templates] | |||
==See also== | |||
* [[:Category:Templates]] - the FSFwiki templates | |||
[[Category:FSFwiki help|{{PAGENAME}}]] | |||
[[category:FSFwiki admin index|{{PAGENAME}}]] | |||
[[Category:Templates| Help]] | [[Category:Templates| Help]] | ||
Latest revision as of 08:51, 9 March 2009
Templates are standard bits of text, links, or formatting that can be applied to a page.
Basic usage
Templates are applied to a page by adding the text {{TemplateName}} to the desired page. Whatever text is on the template page at Template:TemplateName will then be transcluded onto the page -- included by reference. This permits inclusion of the same standard text on multiple pages, and simple editing of that text in one place without inconsistent versions everywhere. Disadvantages include an increase in server processing load and consistent replication of fucked-up versions.
To edit a template, go to the template page itself, e.g., http://wiki.feministsf.net/index.php?title=Template:TemplateName or [[Template:TemplateName]] and edit just like any other wiki page.
However, you should probably not edit unless you're familiar with template syntax.
Useful syntax includes:
- The "noinclude" tag.
- The "noinclude" tag basically takes whatever text is included on that template page and uses it only on the template page, and does not transclude it to other pages. Use it for things like including "usage" instructions on the template page. Another use would be to add categories that help organize the template itself, such as Category:Navigational templates; those categories should not be transcluded onto the content page. Example of usage on a template page:
- <noinclude>
- Apply this template by typing {{PrevNext}}.
- [[Category:Navigational templates]]
- </noinclude>
- <noinclude>
- The "includeonly" tag.
- The "includeonly" tag is the opposite of the "noinclude" tag. It takes whatever is included within the "includeonly" tags and only applies them to the transcluded text. It is particularly useful for applying a standard set of categories to the content page that shouldn't be on the template page. For instance, you might apply the {{feminisms}} template to a page, which asks for more varieties of feminist perspectives to be added to the page, and adds the Category:More feminisms please to the page. That category is useful for people looking through the Category:FSFwiki maintenance categories for work to do, but it doesn't belong on the template page itself. Example of usage on a template page:
- <includeonly>
- Please add other feminist perspectives to this page.
- [[Category:More feminisms please]]
- </includeonly>
- <includeonly>
Further reading
- ParserFunctions at MediaWiki
- Parameter default at MediaWiki
- Help:Templates at Wikipedia
- Help:Advanced templates at Wikipedia
- What you need to know to get started with MediaWiki templates
See also
- Category:Templates - the FSFwiki templates