48,466
edits
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
In a wiki website, templates are | In a wiki website, templates are an effective way to save time by reusing content. They are like regular pages except that their page name begins with the keyword "Template:" (e.g. [[Template:Stub]]) | ||
A Stub template can be included on a stub page (a page that needs more content) by simply inserting <nowiki>{{</nowiki>stub}} on the page. Notice that the keyword (Template:) has been left out and the name of the template page has been surrounded with double curly brackets. Mediawiki calls this a transclusion ([http://www.mediawiki.org/wiki/Transclusion more info]). | |||
Templates can be | Editors can practice including templates on a page by using the [[WikiIslam:Sandbox|Sandbox]] (insert <nowiki>{{</nowiki>stub}} in the page and save or preview it). Templates can also be flexible when they use variables. For example writing <nowiki>{{</nowiki>Quran|2|131}} will use the two variables to make a link to that part of the Qur'an. The result is this: {{Quran|2|131}}. Another example of a templates that uses variables: [[Muhammad and Historys 100 Most Influential People|Muhammad and History's 100 Most Influential People]]. Here the box at the right uses a template. The code for that box can be seen by clicking edit. | ||
Templates can be used to produce small pieces of text like {{Quran|2|131}} or a large piece of content such as the [[Template:QuranHadithScholarsIndex|Index]] table for the Qur'an, Hadith and Scholars pages. If a page contains templates, clicking the Edit link will show a list of all templates used on that page at the bottom of the editing interface. | |||
Like a regular page, links to a template page (like the ones on this page) can be made using square brackets, for example <nowiki>[[</nowiki>Template:Stub]] produces: [[Template:Stub]] | |||
==Templates with Variables== | ==Templates with Variables== |
edits