Difference between revisions of "Template:Template Name"

From Chevy Wiki
Jump to navigation Jump to search
m (1 revision)
 
m (1 revision)
 
Line 1: Line 1:
<includeonly>{{
There are two main ways to use templates on articles: transclusion (also called "inclusion", and accomplished by using {{tl|Template Name}}), and substitution. The former will include the content of Template Name on the fly whenever the article is loaded, while the latter will permanently insert the content of the template into the article. With substitution, even if the template content is modified at a later date, the article's content will not change.
#ifeq:{{lc:{{SUBPAGENAME}}}}|{{lc:{{{subpage-name|sandbox}}}}}
| </includeonly>{{ombox
  | image = [[Image:Sandbox.png|50px]]
  | text = This is the [[Wikipedia:Template test cases|template sandbox]] page for [[{{NAMESPACE}}:{{BASEPAGENAME}}]].{{
    #ifexist:{{#rel2abs: ../testcases }}
    | <br> See also the companion subpage for [[../testcases|test cases]].
    }}
  }}{{{notice-for-sandbox|}}}{{
  #ifeq:{{lc:{{SUBPAGENAME}}}} | testcases
  |
  | <!-- not testcases -->{{{category|[[Category:Template sandboxes|{{PAGENAME}}]]}}}
  }}<includeonly>
| <!-- not sandbox -->{{{notice-not-sandbox|}}}
}}</includeonly><noinclude>


{{documentation}}
Substitution is the preferred method for long-term, permanent notices because it is less confusing, and it even helps to lighten the load on the database. Substitution has the further advantage in that a template's content may be de-linked from any associated category or slightly modified to suit the circumstances, such as when the template is used on a talk page. Transclusion is preferred for displaying material that is normally updated, that way, all the places it appears are updated in a single operation.
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>

Latest revision as of 15:00, 3 February 2009

There are two main ways to use templates on articles: transclusion (also called "inclusion", and accomplished by using {{Template Name}}), and substitution. The former will include the content of Template Name on the fly whenever the article is loaded, while the latter will permanently insert the content of the template into the article. With substitution, even if the template content is modified at a later date, the article's content will not change.

Substitution is the preferred method for long-term, permanent notices because it is less confusing, and it even helps to lighten the load on the database. Substitution has the further advantage in that a template's content may be de-linked from any associated category or slightly modified to suit the circumstances, such as when the template is used on a talk page. Transclusion is preferred for displaying material that is normally updated, that way, all the places it appears are updated in a single operation.