VassarWiki:Templates: Difference between revisions
category |
→Notable templates: expansion |
||
| Line 2: | Line 2: | ||
== Using a template == | == Using a template == | ||
To use a template in the Visual Editor, click "Insert" then "Template", or type two left curly brackets (<code><nowiki>{{</nowiki></code>). From here, you can search for the template you need, and save commonly used templates. | |||
In the Source Editor, you will have to type the syntax manually | In the Source Editor, you will have to type the syntax manually: | ||
<nowiki>{{Name | |||
|parameter1 = value1 | |||
|parameter2 = value2 | |||
}}</nowiki> | |||
Take a look at the desired template's documentation, where there may be example syntax that you can adapt. | |||
If you insert a template with the prefix "subst:" before it (e.g. <code><nowiki>{{subst:Name}}</nowiki></code>), it will substitute the template code into the page and it will longer be editable as a template. You shouldn't do this unless specified on the template documentation. | |||
== Making a template == | == Making a template == | ||
Anyone can make a template! Just create a page with the prefix "Template:" and insert the text and code you wish to be transferred to another page. Templates can be newly written or, to save duplicating work already done, exported from another wiki like Wikipedia, and then imported here. | Anyone can make a template! Just create a page with the prefix "Template:" and insert the text and/or code you wish to be transferred to another page. Templates can be newly written or, to save duplicating work already done, exported from another wiki like Wikipedia, and then imported here. | ||
=== Documentation === | === Documentation === | ||
To make it easy for contributors to use your template, all templates should have documentation. | To make it easy for contributors to use your template, all templates should have documentation. | ||
Without any line breaks or spaces, write "<nowiki><noinclude>{{Documentation}}</nowiki><nowiki></noinclude></nowiki>" at the end of your template―this will transclude the information from your template's documentation page (located at "Template:Example/doc") onto the Template page, but not when using your template on another page. | Without any line breaks or spaces, write "<nowiki><noinclude>{{Documentation}}</nowiki><nowiki></noinclude></nowiki>" at the end of your template―this will transclude the information from your template's documentation page (located at "Template:Example/doc") onto the Template page, but not when using your template on another page. You should also include any categories that apply to the Template | ||
Template documentation should have at least two parts: | Template documentation should have at least two parts: | ||
| Line 20: | Line 27: | ||
== Notable templates == | == Notable templates == | ||
* [[Template:Infobox]]: Meta-template used to make [[:Category:Infoboxes|infobox templates]]. Infoboxes can be placed on pages to easily display basic data/information about a subject. | |||
* [[Template:Userbox]]: Meta-template used to make [[:Category:Userboxes|userbox templates]]. Userboxes are a way to easily communicate about yourself on your [[VassarWiki:User pages|user page]]. | |||
* [[Template:Userbox]]: | |||
* [[Template:See also]] & [[Template:Main article]]: Notes at the top of pages or sections to display important links | * [[Template:See also]] & [[Template:Main article]]: Notes at the top of pages or sections to display important links | ||
== See also == | == See also == | ||
* https:// | * [https://vassar.wiki/wiki/Special:AllPages?from=&to=&namespace=10&hideredirects=1 All template pages] | ||
* [[mediawikiwiki:Help:Templates|MediaWiki's help page on templates]] | |||
[[Category:Page types]] | [[Category:Page types]] | ||