Template repository

From MediaWiki.org
Jump to: navigation, search

This is an idea for something that doesn't exist yet. If you want to help develop this idea, please edit this page.

Idea[edit]

To develop a set of "starter" or "default" templates (template templates, you might even say) that new wiki installs can copy and use.

Motivation[edit]

Pretty and clever templates are very difficult to write from scratch, and copying them from Wikimedia wikis is often very difficult because of extreme template nesting and hindered by licensing concerns. Good templates can enormously improve the look and navigability of a wiki.

Availability of public domain pedagogical templates will encourage wiki authors to build effective Open Educational Resources for a future wherein Open Distance Learning supported by OER would build the inclusive main stream education system all over the world.

Requirements[edit]

  • Templates should be public domain.
  • Templates should be self contained, not calling other templates (or: maybe a maximum of one meta-template?).
    • Templates should have clearly defined dependencies, which can be pulled in along with them.
  • Templates should have usage and modification instructions.
  • Templates should not rely on ParserFunctions (or: they should indicate if they do)[most of the nontrivial mediawiki.org/wikipedia templates use much deeper nesting].
  • Templates should aim to be easy to read and understand even without usage instructions.
  • We should also write some useful CSS that templates use, and ship it with the templates, rather than having manually coded CSS in each one. (bug 35704 may be of interest.)
  • Images - use sparingly for easier re-use?
    • use public domain images if necessary
    • Use PNGs rather than SVGs for easier re-use (PNG uploads are configured by default, SVGs are not)
    • Maybe offer multiple versions of templates? one with SVG, one with PNG, one with no image.
    • Commons images? (Can you say instant commons)?

Guidelines for template writers[edit]

  • Don't try to make the most extensible template ever; don't keep everything as variable for the user to provide, e.g. alignment of boxes, just pick an alignment and hard-code it.

Distribution[edit]

Ways that people can get the templates:

  • Possibly bundled - included by default?
  • An extension?
  • Special:Export This will always work, but it's not so much fun for a large number of pages, and it may require exporting metatemplates separately. Also images still have to be manually copied, unless hosted in Wikicommons.

Needed templates[edit]

Corresponding Existing MW Templates[edit]

This is a list of existing MW templates that would probably be included along with their required dependancies.

Type Template Description Dependencies Images
Mbox
{{ambox}} Article message box.
{{cmbox}} Category message box.
{{imbox}} Image message box.
{{ombox}} Other pages message box.
{{tmbox}} Talk page message box.
{{Mbox templates}}
{{asbox}} Article stub box.
{{dmbox}} Disambiguation footer message box.
{{fmbox}} Footer & Header message box
Wikipedia:Template:Navboxes {{Navbox_suite}}
{{Navbar}} Adds navbar navigational functionality.
{{Navbox_subgroup}} Allows the creation of subgroups that can be assigned to a list item within {{Navbox}}. A subgroup may contain up to 20 list items.
{{Navbox_with_collapsible_groups}} Produces a navigation template that has groups of relevant articles on a certain topic. All groups are hidden by default. However, with a parameter call, an individual group can be shown that has the other articles in the same group.
{{Navbox_with_columns}} Presents its content in columns.
Template:Documentation

Dependencies[edit]

There needs to a difference between whether the dependency is required for the template itself or rather the template documentation. If it is for the template documentation, is it necessary?

Template name Description
Template:!
Template:Badge
Template:Border-radius This template is a shortcut for producing rounded corners. It generates the CSS for various browsers. Supported browsers are the current versions of Opera, Firefox, Safari, Chrome and Internet Explorer 9.
Template:Category handler This is the meta-template.

It helps other templates to automate both categorization and category suppression.

Template:Category handler/blacklist
Template:Category handler/numbered
Template:Clear
Template:High-risk "This template is used on a very large number of pages."
Template:If pagename Helps other templates detect what page they are on. It uses pattern matching on the pagename.
Template:Mbox templates
Template:Namespace detect Helps other templates detect what type of page they are on.
Template:Nowrap
Template:Shortcut
Template:Shortcut/layout
Template:Tl Redirects to Template:Tlx
Template:Tlx This template creates example usage syntax for a template, and links the name to the template page. The "SISTER" parameter specifies an interwiki prefix to link to another wiki.
Template:Yesno Normalises an input to be a yes/no output.
Template:File_other
Template:File_title
Template:TOC
Template:Template other
Template:Information
Warning
One variable.
Ambox
AKA cleanup/article message box. Could be same as warning?
No variables
Tip
One variable
User welcome
For user talk pages
No variables (put names external to template)?
Edit request
For protected pages - put on talk page
No variables - acts as a "tag" and people put their request below.
Inline
aka "citation needed"
no variables.
Licenses
no variables.
Ratings
Like WikiProject talk page templates
a small number of variables.
Userboxes
No variables.
Pedagogical templates
to develop Open Educational Resources (OERs)
Documentation
no variables; include { {SUBJECTPAGENAME} }/doc, and allow editing it

Template dependencies[edit]

These are templates and images that exist solely as variable dependancies for the above Templates. Without these, the above templates would not work.

Variables[edit]

TBD

Images[edit]

External links[edit]

  • Wikia Templates, a wiki collating wiki templates (for use on other Wikia wikis). Partially MediaWiki compatible.