WikiIslam:Templates

From WikiIslam, the online resource on Islam
Revision as of 11:43, 25 December 2012 by Axius (talk | contribs)
Jump to navigation Jump to search

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 A Stub template can be included on a stub page (a page that needs more content) by simple insert {{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 (more info).

Try including a template right now in the Sandbox page by insert {{stub}} in the page and saving or previewing 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 Quran. The result is this: Quran 2:131. Another example of a templates that uses variables: 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.

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 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.

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 [[Template:Stub]] produces: Template:Stub

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

Articles that need attention

Misc Templates

Reference

  • Template:Reflist - produces a Reference list at the bottom of an article when references (<ref> tags) are used in an article
  • 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

Welcoming new members

Click on a new member's talk page and it will prompt you for creating a new page. Place this in the edit box and save the page:

{{subst:New Member}}

This will place (substitute) a welcome template on their talk page with your username. The template used here is Template:New Member.

Users with IP addresses
  • Template:Unsigned - for IP address users who did not sign their comment on a talk page.

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

  • Qif: A template which allows you to make IF statements, similar to how they're used in programming languages.
  • Template:Loop - From Wikipedia, "This template is used to produce a simple loop that can repeat up to 150 times. It is not a real loop; it works by conditionally repeating the string."
  • Template:Pipe - used inside a template to produce a pipe: |

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)