Line 2: |
Line 2: |
| {{TOCleft}} | | {{TOCleft}} |
| | | |
− | __NOTOC__ A '''template''' is a wiki page which is created to be included on other pages. Template pages are created and edited just like other pages on GCpedia, except that they are created in the [[GCPEDIA:Template namespace|Template namespace]]. | + | __NOTOC__ A '''template''' is a wiki page which is created to be included on other pages. Template pages are created and edited just like other pages on Wiki, except that they are created in the [[GCPEDIA:Template namespace|Template namespace]]. |
| | | |
− | Templates usually contain repetitive material that might need to show up on several wiki pages. They are commonly used for boilerplate messages, standard warnings or notices, infoboxes, navigational boxes and similar purposes. GCpedia generates a dynamic list of the [[Special:MostLinkedTemplates|most frequently used templates]] on GCpedia, and the user community maintains an inventory of [[Help:Notice templates|notice templates]] that go at the top of articles, [[UBX|userboxes]] which are used on user pages, and a general index of [[GCPEDIA:Template inventory|other templates]]. | + | Templates usually contain repetitive material that might need to show up on several wiki pages. They are commonly used for boilerplate messages, standard warnings or notices, infoboxes, navigational boxes and similar purposes. Wiki generates a dynamic list of the [[Special:MostLinkedTemplates|most frequently used templates]] on Wiki, and the user community maintains an inventory of [[Help:Notice templates|notice templates]] that go at the top of articles, [[UBX|userboxes]] which are used on user pages, and a general index of [[GCPEDIA:Template inventory|other templates]]. |
| | | |
| By using a template the content can be present on as many articles as necessary and if it is edited the changes will be reflected everywhere it appears. | | By using a template the content can be present on as many articles as necessary and if it is edited the changes will be reflected everywhere it appears. |
Line 15: |
Line 15: |
| | | |
| Transclusion is the 'default' method of using templates, meaning it is the method that will be chosen by the wiki software when <code><nowiki>{{Template_Name}}</nowiki></code> is typed; this will cause the content of the template page to appear in the wiki page at the place where <code><nowiki>{{Template_Name}}</nowiki></code> appears in the wiki-text. Should the template change, its appearance on all pages that use it in this way will also change accordingly. <!-- | | Transclusion is the 'default' method of using templates, meaning it is the method that will be chosen by the wiki software when <code><nowiki>{{Template_Name}}</nowiki></code> is typed; this will cause the content of the template page to appear in the wiki page at the place where <code><nowiki>{{Template_Name}}</nowiki></code> appears in the wiki-text. Should the template change, its appearance on all pages that use it in this way will also change accordingly. <!-- |
− | ===Useful pre-fabricated GCPEDIA templates=== | + | ===Useful pre-fabricated Wiki templates=== |
| * {{tl|Archive}} - insert this banner template indicating the need to archive information | | * {{tl|Archive}} - insert this banner template indicating the need to archive information |
| * {{tl|Cleanup}} - insert this template to indicate that the wiki page needs be better organized, better formatted, etc | | * {{tl|Cleanup}} - insert this template to indicate that the wiki page needs be better organized, better formatted, etc |
Line 72: |
Line 72: |
| === Template documentation === | | === Template documentation === |
| | | |
− | Most templates on GCpedia have documentation that has been written to describe their usage and any variables that may be defined. It is good practice to read the documentation for a template in order to better understand how they are meant to be used. | + | Most templates on Wiki have documentation that has been written to describe their usage and any variables that may be defined. It is good practice to read the documentation for a template in order to better understand how they are meant to be used. |
| | | |
| == Creating and editing templates == | | == Creating and editing templates == |
| | | |
− | Any GCpedia user can create a template. To create a template add a line to your article that looks like this <code><nowiki>{{Name of my template}}</nowiki></code>. It will appear as a broken (red) link, for example {{Name of my template}}. Clicking on it will take you to the template page and you can now add the content for the template. This is the same method used to create any page on GCPEDIA. An alternative method is to search for the name of your desired template in the search box making sure to include the prefix "Template:". For example, searching for <code>"Template:Name of my template"</code> will also work. | + | Any Wiki user can create a template. To create a template add a line to your article that looks like this <code><nowiki>{{Name of my template}}</nowiki></code>. It will appear as a broken (red) link, for example {{Name of my template}}. Clicking on it will take you to the template page and you can now add the content for the template. This is the same method used to create any page on Wiki. An alternative method is to search for the name of your desired template in the search box making sure to include the prefix "Template:". For example, searching for <code>"Template:Name of my template"</code> will also work. |
| | | |
− | Once you have created your template page, add content to it by editing it the same as you would do for any page on GCpedia. | + | Once you have created your template page, add content to it by editing it the same as you would do for any page on Wiki. |
| | | |
| To transclude the content of your template to any page you now just need to include <code><nowiki>{{Name of my template}}</nowiki></code> where you want it to appear on the page. To transclude your template, include <code><nowiki>{{subst:Name of my template}}</nowiki></code> where you want it to appear on the page. | | To transclude the content of your template to any page you now just need to include <code><nowiki>{{Name of my template}}</nowiki></code> where you want it to appear on the page. To transclude your template, include <code><nowiki>{{subst:Name of my template}}</nowiki></code> where you want it to appear on the page. |
Line 91: |
Line 91: |
| To see a full listing of templates, click on a letter of interest. {{GCPEDIATemplatesIndex}} | | To see a full listing of templates, click on a letter of interest. {{GCPEDIATemplatesIndex}} |
| | | |
− | *[[Special:PrefixIndex/Template:|All templates in GCPEDIA]] | + | *[[Special:PrefixIndex/Template:|All templates Wiki]] |
| | | |
| == External links == | | == External links == |
Line 99: |
Line 99: |
| *[http://en.wikipedia.org/wiki/Help:Advanced_templates Wikipedia - Help: Advanced templates] | | *[http://en.wikipedia.org/wiki/Help:Advanced_templates Wikipedia - Help: Advanced templates] |
| | | |
− | [[Category:GCPEDIA_Help]]
| + | |
| [[fr:Aide:Modèles|fr:Aide:Modèles]] | | [[fr:Aide:Modèles|fr:Aide:Modèles]] |