Difference between revisions of "Manual:Template"

[unchecked revision][quality revision]
(Tag: 2017 source edit)
(Tag: 2017 source edit)
 
What are templates

What is a template?[edit | edit source]

Templates are (source)-text templates A template is a type of reusable content that can be integrated into other pages of the wiki. On the one hand, this has the advantage of outsourcing frequently used components such as letter templates or checklists so that they do not have to be recreated every time. On the other hand, a certain uniformity can be ensured by means of templates. In addition, using templates provides some flexibility, as changes can be centralized and affect all pages that access the template. Accordingly, possible applications for templates are the management of messages, the presentation of consistent navigation areas, or simply the unification of a group of pages.

Create new templates[

It can be content-based (text template) or structure-based (layout template) or a combination of both.

A simple example is a notification box that looks identical on all pages, but contains different content on each page where it is used (layout template).

template-note.png

A template can also be used as the source for a page template.

Characteristics of a template[edit | edit source]

  • allows inserting reusable content with a placeholder
  • is usually located in the namespace "Template"
  • can have parameters
  • often contains logic
  • used to maintain a "look and feel"

[

Creating and including a template[edit | edit source]

A new template is created just like an article a regular page, just but in the namespace Template.

For example, the full page name of a template MyPatient is Template:MyPatient.

Note: Please note that the names of templates are "case-sensitive" and therefore case-sensitive.

Use existing templates[edit | edit source]

A template is used


A template is then included in a page by putting the name of the template (ie i.e., the title of the template page , without the name space namespace prefix "Template:") in two curly brackets:{{

My original}}

Such a usage causes the parenthesized text to be replaced with the source text of the template when calling the using page. The source text of the using page will continue to contain the compounded text so future changes to the template will affect existing uses of the template as well. The source code of the template can also be generated optionally when the page is saved instead of when the page is called up. The following form is used for this:

{{subst:My original}}

This may be useful if you want to create an initial text that you want to change later on each new page.

For templates, the namespace "Template:" is reserved. All pages in this namespace are considered templates, but not all of these templates may be relevant to any article author. The complete list of all pages in this namespace can be found using the Special page of the namespace Template.

Edit existing templates

NotificationBox}}

Note: Template names are case-sensitive.

Editing a template[edit | edit source]

Changes to a template affect all pages that include this template. Before existing templates are changed significantly, the project should be briefly discussed or announced on the discussion page of the respective template. , it is recommended that you check which pages use the template. To find these pages, you can go to Page tools > Toolbox > What links here.

Built-in variables[edit | edit source]

Each MediaWiki has a number of built-in variables that are not pages in the "template:" namespace, but are still used as templates.

For example, the variable {{CURRENTTIME}} ( returns the the current UTC time) currently returns the value 04:47.

Further notes[edit | edit source]

  • The use of templates a template is basically translusionsa transclusion. It is also possible to use pages as templates that are not in the corresponding Template namespace as templates. However, this is to be done wisely, since some functions require that the pages are in the template namespace.
  • Templates can also be used to define the output of [1] semantic query. For more information, see herego to Semantic MediaWiki. (This is an example where the pages must necessarily be in the template namespace.)

Templates at BlueSpice[edit | edit source]

Internal links[edit | edit source]

External Link[edit | edit source]

  • The complete list of all pages of the wiki that are located in this namespace can be found on the page Special:Templates.

Related info


Attachments

Discussions