Help:A quick guide to templates

From Wikiquote
Jump to navigation Jump to search

This is a copy of the master help page at m:Help:A quick guide to templates. Do not edit this page. Edits will be lost in the next update from the master page. Either edit the master help page for all projects at Meta, or edit the project-specific text at Template:Ph:A quick guide to templates. You are welcome to copy the exact wikitext from the master page at Meta and paste it into this page at any time.


Editing overview

Starting a new page

  1. Page name

Referencing

  1. Links
  2. Piped links
  3. Interwiki linking
  4. Variables
  5. URLs
  6. Anchors

Formatting

  1. Formulas
  2. Lists
  3. Tables
  4. HTML in wikitext
  5. Image & File uploads
  6. Image page

Organizing

  1. Sections
  2. Templates
  3. Categories
  4. Redirects
  5. Namespaces
  6. Renaming (moving) a page

Fixing mistakes and vandalism

  1. Reverting edits
  2. Testing

Saving effort

  1. Editing shortcuts
  2. Editing toolbar
  3. Magic words

Communicating

  1. Edit summary
  2. Talk page
  3. Edit conflict
  4. Minor edit

Special characters

  1. Turkish characters
  2. Romanian characters

Extensions

  1. WikiHiero syntax — warning: lots of images! (for Egyptian hieroglyphs)
  2. EasyTimeline syntax

Frequently Asked Questions


This is a quick overview of templates. Full details can be found in Help:Template and Help:Template names, variable names and parameters depending on a variable or parameter.

Templates are pages in the template namespace. This means any page beginning with "Template:", such as [[Template:Templatename]]. The content of a template can be added to a page by typing {{templatename}}.

Templates are used to add recurring messages to pages in a consistent way, to add boilerplate messages, to create navigational boxes and to provide cross-language portability of texts.

Creating, editing and using templates[edit]

You start a new template in the same way you would start a normal page. The only difference is that its title must start with Template:.

Once you have made the template, you can add {{templatename}} to the pages you want to use it on. Every page using this template will get the same boilerplate text, each time a user visits it. When the template is updated, all pages containing the template tag will automatically be updated.

Alternatively, you can add {{subst:templatename}} to the pages you want to use the boilerplate text on. The system will fetch a one-time copy of the template text and substitute it into the page, in place of the template tag. If anyone edits the template afterwards, pages that used the subst: keyword will not be updated. Sometimes that's what you want.

If the template you want to edit looks like {{foo}}, you would go to Template:foo to edit it. To get there, type in the URL to your address bar, search for it, or make a link in the sandbox and click on it.

Once you are there, just click "edit" or "edit this page" and edit it in the same way you would any other page. You can add anything you would add to a normal page, including text, images and other templates. Please be aware that your edit might affect many pages, so be cautious.

FAQ[edit]

Can I use a template in more than one project?
No, if you want to use it on two different language Wikipedias, for example, you would need to create it twice.
Are templates case sensitive?
Yes, except usually the first letter.
Can I add parameters?
Yes, see Help:Template for instructions.
How many templates can I use in a page?
As many as you like (in older versions you could not use the same one more than 5 times).
I edited the template, so why didn't the page it is used on change?
There are some caching bugs. Refreshing by pressing Ctrl and F5 often helps.
Can I move a template to a new name?
Yes, this works in exactly the same way as normal page moves. When a page called for inclusion is a redirect page, the redirect target is included instead.
Can I use a template within a template?
You can use a template tag within template content, but not within a template tag: in the latter case the parser will prematurely end the original template tag when it reaches the first pair of curly closing braces.

Examples[edit]

Wikiquote-specific content[edit]

Edit this Wikiquote- and subject-specific template

Links to other help pages[edit]

Help contents - all pages in the Help namespace: Meta b: c: n: w: q: wikisource wiktionary


Reading: Overview | Go | Search | URL | Namespace | Page name | Section | Link | Backlinks | Piped link | Interwiki link | Redirect | Variable | Category
Tracking changes: Recent | (enhanced) | Related | Watching pages | Page history | Diff | User contributions | Edit summary | Minor edit
Logging in and preferences: Logging in | Preferences | User style
Editing: Overview| New page | Images/files | Image description page | Special characters | Formula | Table | EasyTimeline | Template intro | Renaming (moving) a page | Automatic conversion of wikitext | Talk page | Testing | rlc
Projects: Meta (master page) | Wikibooks | Wikicommons | Wikinews | Wikipedia | Wikiquote | Wikisource | Wiktionary
For other languages see Meta.

External Links[edit]

commons
commons
Wikimedia Commons has media related to: