Please check our Instructions to Authors and send your manuscripts to nifs.journal@gmail.com. Next issue: September/October 2024.
Deadline for submissions: 16 November 2024.
Help:Templates: Difference between revisions
New page: {{help-pages/2}} The wiki templates are pages from the <tt>Template:</tt> namespace (id 10), which give the possibility for inclusion of one and the same piece of source code (text, graph... |
m Download-icon.png |
||
Line 15: | Line 15: | ||
Templates may have optional or obligatory parameters, separated from the template name and among themselves by means of the pipe character <tt>|</tt>. For instance, template <tt>[[Template:Download|<nowiki>{{download|||}}</nowiki>]]</tt> has three obligatory parameters, first is filename of an uploaded file, second is file format, third is file size. Thus: | Templates may have optional or obligatory parameters, separated from the template name and among themselves by means of the pipe character <tt>|</tt>. For instance, template <tt>[[Template:Download|<nowiki>{{download|||}}</nowiki>]]</tt> has three obligatory parameters, first is filename of an uploaded file, second is file format, third is file size. Thus: | ||
<nowiki>{{download| | <nowiki>{{download|Download-icon.png|PNG|3}}</nowiki> | ||
gives: {{download| | gives: {{download|Download-icon.png|PNG|3}} . | ||
Certain templates are made in such a way, to automatically categorize the pages, which call them. For instance, template <tt>[[Template:Stub|<nowiki>{{stub}}</nowiki>]]</tt> categorizes the pages as [[:Category:Stubs|stubs]] (short articles that need to be enlarged). | Certain templates are made in such a way, to automatically categorize the pages, which call them. For instance, template <tt>[[Template:Stub|<nowiki>{{stub}}</nowiki>]]</tt> categorizes the pages as [[:Category:Stubs|stubs]] (short articles that need to be enlarged). |
Latest revision as of 22:09, 28 October 2008
First steps | Page editing | Page management | Namespaces | Tools and settings |
Starting a new page • Edit mode • Text formatting • Formulas • Tables • Images • Categories • Templates • References • Subpages |
The wiki templates are pages from the Template: namespace (id 10), which give the possibility for inclusion of one and the same piece of source code (text, graphics, formatting) on multiple pages. Templates allow whenever edits and updates of the information are necessary, to make these only once in the template page, and the changes get automatically visible on the pages calling the template. This dynamic use of the templates is called transclusion.
The transclusion functionality is available not only to the pages from the Template: namespace, but also to pages and subpages from other namespaces. For instance, there are certain situations requiring transclusion of pages and subpages from the main namespace, but in general this role is given to the templates.
The main reasons to export a piece of information into a template, are:
- easy support — when the information has to be included on multiple pages and often requires update or editing.
- economy — when the repetitive piece of information is large in size.
- formatting style consistency — when the same functional and aesthetic design has to be applied on multiple pages.
Transclusion occurs any time when the pagename of the template page has been typed in another wiki page and enclosed by a pair of curly brackets. The button may also be used for this purpose. For instance,
{{at}}
gives: @ (i.e. Image:At_sign.png with image width of 12px, used as an antispam security measure to replace the regular @ sign in email addresses).
Templates may have optional or obligatory parameters, separated from the template name and among themselves by means of the pipe character |. For instance, template {{download|||}} has three obligatory parameters, first is filename of an uploaded file, second is file format, third is file size. Thus:
{{download|Download-icon.png|PNG|3}}
gives: PNG (3 Kb, File info) .
Certain templates are made in such a way, to automatically categorize the pages, which call them. For instance, template {{stub}} categorizes the pages as stubs (short articles that need to be enlarged).
Some templates are very easy, but others require a little bit of programming and knowledge of CSS.
See also
- Category:Templates - all categorized templates
- All pages in Template: namespace
- Help:Template from Meta-Wikipedia
- Transclusion from Meta-Wikipedia
- Help:Contents with links to other help pages