Line 2: |
Line 2: |
| | | |
| == Introduction == | | == Introduction == |
− | Templates often look like text boxes with a different background color from that of normal text. They are in the [[Centiare:Template namespace|template namespace]], i.e. they are defined in pages with "Template:" in front of the name. | + | Templates often look like text boxes with a different background color from that of normal text. They are in the [[Help:Template namespace|template namespace]], i.e. they are defined in pages with "Template:" in front of the name. |
| | | |
| Templates can accept template parameters which are then inserted into the output of the template. | | Templates can accept template parameters which are then inserted into the output of the template. |
Line 8: |
Line 8: |
| Templates in the article namespace provide information to help readers. These can include navigation aids, or warnings that content is sub-standard. Templates that provide information only of service to editors belong on an article's talk page. | | Templates in the article namespace provide information to help readers. These can include navigation aids, or warnings that content is sub-standard. Templates that provide information only of service to editors belong on an article's talk page. |
| | | |
− | With the '''template [Centiare:namespace|]]''' it is possible to include the contents of a page in that namespace within a page in a different namespace, using double curly braces around the template title (for example, <nowiki>{{title}}</nowiki> would import [[Template:Title]]). This is used to: | + | With the '''template [Help:namespace|]]''' it is possible to include the contents of a page in that namespace within a page in a different namespace, using double curly braces around the template title (for example, <nowiki>{{title}}</nowiki> would import [[Template:Title]]). This is used to: |
| * place recurring messages (such as those to denote [[stubs]], disambiguation pages, etc.) into articles in a consistent manner; | | * place recurring messages (such as those to denote [[stubs]], disambiguation pages, etc.) into articles in a consistent manner; |
| * insert [[Boilerplate (text)|boilerplate messages]] for various issues like copyright violation, neutrality disputes, etc., using a simple shortcut command; and | | * insert [[Boilerplate (text)|boilerplate messages]] for various issues like copyright violation, neutrality disputes, etc., using a simple shortcut command; and |
− | * create [[Centiare:Navigational templates|navigational templates and sidebars]] to link series of related articles together. | + | * create [[Help:Navigational templates|navigational templates and sidebars]] to link series of related articles together. |
− | * create [[Centiare:Infobox templates|infoboxes]] | + | * create [[Celp:Infobox templates|infoboxes]] |
| | | |
| Templates should not masquerade as article content in the main article namespace; instead, place the text directly into the article. | | Templates should not masquerade as article content in the main article namespace; instead, place the text directly into the article. |
| | | |
− | Templates should also not be used to create lists of links to other articles when a [[Centiare:Categories|category]] or a [[Centiare:See also|See also list]] can perform the same function. | + | Templates should also not be used to create lists of links to other articles when a [[Help:Categories|category]] or a [[Help:See also|See also list]] can perform the same function. |
| | | |
| === Template creation === | | === Template creation === |
− | To create a new custom message, simply create a page in the Template namespace, named "Template:", followed by a name for the message, that contains the text of the message. Names can now contain spaces and initial case is irrelevant. An alternate method is to create a link something like '''<nowiki>[[Template:mymessage]]</nowiki>''' on your user page or in the [[Centiare:Sandbox|sandbox]] and then click on it. You may want to consider protecting the messages you create (if you have administrator privileges), but see the [[Centiare talk:Template messages|talk page]] for a discussion of this. Please list any custom messages you create on this page. | + | To create a new custom message, simply create a page in the Template namespace, named "Template:", followed by a name for the message, that contains the text of the message. Names can now contain spaces and initial case is irrelevant. An alternate method is to create a link something like '''<nowiki>[[Template:mymessage]]</nowiki>''' on your user page or in the [[Help:Sandbox|sandbox]] and then click on it. You may want to consider protecting the messages you create (if you have administrator privileges), but see the [[MyWikiBiz talk:Template messages|talk page]] for a discussion of this. Please list any custom messages you create on this page. |
| | | |
| === Usage === | | === Usage === |
Line 35: |
Line 35: |
| | | |
| === Dynamic or subst === | | === Dynamic or subst === |
− | :''Main article: [[Centiare:Template substitution]]'' | + | :''Main article: [[Help:Template substitution]]'' |
| | | |
| There are two major ways to include custom messages, <tt>'''<nowiki>{{Your message}}</nowiki>'''</tt> and <tt>'''{{<font color=red>subst:</font>Your message<nowiki>}}</nowiki>'''</tt>. <tt><nowiki>{{subst:Your message}}</nowiki></tt> makes a copy of the message text and places it where you put the tag after you save an article (substitution). Without "subst", the message will be loaded and put on the page every time you view it, a process known as [[transclusion]]. | | There are two major ways to include custom messages, <tt>'''<nowiki>{{Your message}}</nowiki>'''</tt> and <tt>'''{{<font color=red>subst:</font>Your message<nowiki>}}</nowiki>'''</tt>. <tt><nowiki>{{subst:Your message}}</nowiki></tt> makes a copy of the message text and places it where you put the tag after you save an article (substitution). Without "subst", the message will be loaded and put on the page every time you view it, a process known as [[transclusion]]. |
Line 70: |
Line 70: |
| === A caution about line breaks === | | === A caution about line breaks === |
| | | |
− | Note that some templates may accidentally cause extra linebreaks in the rendered articles. This is especially true of [[Centiare:Infobox templates]] and other template boxes that usually float on the right side of an article, since the additional lines will not be seen on the template page. | + | Note that some templates may accidentally cause extra linebreaks in the rendered articles. This is especially true of [[Help:Infobox templates]] and other template boxes that usually float on the right side of an article, since the additional lines will not be seen on the template page. |
| | | |
| As a general guideline, avoid two break lines together in your template. These may "add up" with other breaklines in the article and be displayed as unwanted white space. | | As a general guideline, avoid two break lines together in your template. These may "add up" with other breaklines in the article and be displayed as unwanted white space. |