WikiIslam:Templates

Templates are an effective way of standardizing content. They are like regular wiki 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 {{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 (more info).

Editors can practice including templates on a page by using the Sandbox (insert {{stub}} in the page and save or preview it). Templates can also be flexible when they use variables. For example writing {{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.

Templates can be used to produce small pieces of text like Quran 2:131 or a large piece of content such as the 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 [[Template:Stub]] produces: Template:Stub

Templates with Variables

Templates that accept variables are a way to let the software take care of formatting issues. For example when putting in a reference to a website, the Cite web template can be used. All that is needed is the URL, URL Title, author, publisher and archive URL and it will automatically format the output. So, for example, editors would not have to worry about whether the author is mentioned first in that reference.

Using variables also makes sure that formatting remains consistent in all those occurrences of cite web. If the formatting was inputted manually, editors may place the author at the end of the reference and at other times place them at the beginning. Templates will make sure the output is consistent.

They also enable easy system-wide changes. The Qur'an template also uses variables and has been updated multiple times when source websites had to be updated. System wide changes were made instantly which would be almost impossible to make if a template had not been used.

Any time an editor is formatting text in a certain way (for example: "date, author - URL (website title)"), that means it can usually be done through templates.

Template:Tabari is an example of a template that uses a simple type of input and produces a different output.

Here are some templates that can be used on the website.

Articles that Need Attention

Misc Templates

  • Flag - produces a flag icon for a country.
  • Template:Spaces - inserts blank spaces in text
  • Template:Small - small text
  • Template:Fontcolor - used to change font color when needed
  • Template:New - produces a "new" icon/image
  • Template:Page title - used to change the heading of a page, since page names should ideally not contain brackets, commas and some other characters. Some websites and forums break links with these characters in them. This template produces a safe URL with any page heading.
  • WikiIslam:Standardization - for templates related to Islamic texts

References

  • Template:Reflist - produces a reference list at the bottom of an article when references (<ref> tags) are used
  • Template:Reference archive - used for links to WebCitation.org, which is used for preserving links in the long term

Books and People

Links and Navigation

Communicating with Users

Writing Templates

Wikipedia has many templates that can be used here. Templates can be written using the page title format Template:My template. This template can then be used on a page using this notation: {{My template}}

Documentation: As on Wikipedia, documentation for templates can be written on the page: Template:My template/doc, if the code {{Documentation}} has been included in the template.

Programming in Templates

See Also

  • Full list of all templates (system generated; Note that many templates are used for very specific group of articles and some templates have more complex uses)