WikiIslam:Templates: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
In a wiki website, templates are great ways to save time by reusing content. They are just like regular pages except that their page name begins with the keyword "Template:". For example see [[Template:Stub]]
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 simple insert <nowiki>{{</nowiki>stub}} on the page. Notice that we left out the keyword (Template:) and surrounded the name of the template page with double curly brackets. Mediawiki calls this a transclusion ([http://www.mediawiki.org/wiki/Transclusion more info]).


Try including a template right now in the [[WikiIslam:Sandbox|Sandbox]] page by insert <nowiki>{{</nowiki>stub}} in the page and saving or previewing 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 Quran. 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. You can see the code for that box by clicking edit.
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 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 Quran, Hadith and Scholars pages. If a page contains templates, clicking the Edit link will show you a list of all templates used on that page at the bottom of the editing interface.
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.


Just like a regular page, links to a template page (like we have made on this page) can be made using square brackets, for example <nowiki>[[</nowiki>Template:Stub]] produces: [[Template:Stub]]
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==
48,466

edits

Navigation menu