Media Wiki Concepts: Difference between revisions
Line 3: | Line 3: | ||
* [[Media Wiki#Subjects|Media Wiki]] | * [[Media Wiki#Subjects|Media Wiki]] | ||
=Security= | |||
* {{Internal|Media Wiki Security Concepts|Security Concepts}} | |||
=Transclusion= | =Transclusion= |
Revision as of 18:05, 20 February 2018
Internal
Security
Transclusion
Transclusion means the inclusion of the content of a document into another document by reference. The most common situation where transclusion is used is the use of templates: the same content can be included in multiple documents without having having to edit those documents separately.
Namespace
Templates
A template is a page in the "Template:" namespace that gets transcluded in regular pages that refer to it. This mechanism is useful to disseminate complex content into multiple target pages, while editing the source context in just one place and referring to it via a simple name from the target pages.
Template Declaration
To start a new template, declare a link in the "Template:" namespace, as shown below
[[Template:TestTemplate]]
follow the link, and edit it. The initiating page will contain the link to the template and can be used for access. For an example of actual template declarations see the "Editing - Blockquote" section.
Parameterized Templates
MediaWiki performs variable substitution in templates, where the variables are declared as {{{1}}}, {{{2}}}, etc. A template that contains variables is called a parameterized template.
Template Invocation
The template is invoked by enclosing the template name (without the Template: namespace prefix) between {{ }}.
Example:
{{SomeTemplate}}
If the template is parameterized, the parameters are provided in order, after the template name, preceded by "|".
Example:
{{SomeTemplate|paramenter one content|parameter two content}}