Difference between revisions of "Templates"
m (Redirected page to Template) (Tags: New redirect, Visual edit) |
- REDIRECT Template
Contents
- 1Was sind Vorlagen What are templates?
- 2 Existierende Vorlagen benutzen
- 3 Existierende Vorlagen editieren
- 4 Neue Vorlagen erstellen
- 5 Eingebaute Variablen 6 Vorlagen bei BlueSpice
- 6.1 Interne Links 6
- Creating new templates
- 3 Usage of existing templates
- 4 Editing existing templates
- 5 Built-in variables
- 6 Further notes
- 7 Templates in BlueSpice
Was sind VorlagenWhat are templates?[edit | edit source]
Vorlagen (engl: Templates) sind (QuellTemplates contain (source-)Textvorlagen, die in andere Seiten des Wikis eingebunden werden können. Dies hat zum einen den Sinn, öfter verwendete Bestandteile wie Briefvorlagen oder Checklisten auszulagern, um sie nicht jedes Mal neu erstellen zu müssen. Zum anderen kann mittels Vorlagen eine gewisse Einheitlichkeit gewährleistet werden. Darüber hinaus bietet die Verwendung von Vorlagen eine gewisse Flexibilität, da Änderungen zentral gemacht werden können und sich auf alle Seiten auswirken, die auf die Vorlage zugreifen. Dementsprechend sind mögliche Anwendungen für Vorlagen die Verwaltung von Mitteilungen, die Darstellung einheitlicher Navigationsbereiche oder einfach die Vereinheitlichung einer Gruppe von Seiten.
Existierende Vorlagen benutzencode, that can be included at different places of the wiki. On the one hand, it makes sense to outsource frequently used components such as letter templates or checklists so that they do not have to be recreated each time. Templates can also ensure some amount of consistency regarding content structure and styling. In addition, the use of templates offers some flexibility, as changes can be made centrally and affect all pages that access the template. Accordingly, possible applications for templates are the management of messages, the creation of uniform navigation areas or simply the unification of a group of pages.
Creating new templates[edit | edit source]
Eine Vorlage wird in einer Seite benutzt, indem man den Namen der Vorlage (also den Titel der Vorlagen-Seite, ohne den Namensraum "Vorlage:") in zwei geschweifte Klammern setzt:
- {{MeineVorlage}}
Eine solche Benutzung bewirkt, dass beim Aufrufen der benutzenden Seite der geklammerte Text durch den Quelltext der Vorlage ersetzt wird. Der Quelltext der benutzenden Seite enthält auch weiterhin den geklammerten Text, so dass künftige Änderungen der Vorlage sich auch auf bereits bestehende Benutzungen der Vorlage auswirken. Der Quelltext der Vorlage kann auch wahlweise bereits beim Abspeichern der Seite erzeugt werden, statt beim Aufrufen der Seite. Dazu wird die folgende Form verwendetA new template is created like an article page, only in the namespace template.
Example: The whole page name of the template MyTemplate is Template:MyTemplate.
Usage of existing templates[edit | edit source]
You can use a template on a wiki page by putting the template name (without the namespace name) in double curly brackets:
- {{MyTemplate}}
Such use causes the bracketed text to be replaced by the source text of the template when the page being used is accessed. The source code of the using page still contains the bracketed text, so that future changes to the template will also affect existing uses of the template. The source code of the template can also be generated when the page is saved instead of when the page is called. The following form is used for this:
- {{subst:MeineVorlage}}
Das kann sinnvoll sein, wenn ein initialer Text erzeugt werden soll, der später auf jeder neuen Seite geändert werden können soll.
Für Vorlagen ist der Namensraum "Template:" reserviert. Alle Seiten in diesem Namensraum werden als Vorlagen betrachtet, aber möglicherweise sind nicht alle diese Vorlagen für jeden Artikel-Autor auch relevant. Die komplette Liste aller Seiten in diesem Namensraum kann über die Spezialseite des Namensraums Template gezeigt werden. Die für die meisten Artikel-Autoren relevanten Vorlagen sind auf Vorhandene Vorlagen gelistet und erklärt.
- MyTemplate}}
This can be useful if you want to create an initial text that can later be changed on each new page.
The namespace "Template:" is reserved for templates. All pages in this namespace are considered templates, but not all of them may be relevant to every article author. A complete list of pages in that namespace can be seen on special page of the namespace Template.
Editing existing templates[edit | edit source]
Bevor existierende Vorlagen signifikant geändert werden, sollte auf der Diskussionsseite der jeweiligen Vorlage das Vorhaben kurz diskutiert oder angekündigt werden.
Neue Vorlagen erstellen[edit | edit source]
Eine neue Vorlage wird ganz normal wie eine Artikel-Seite erstellt, nur eben im Namensraum Vorlage.
Beispiel: Der vollständige Seitenname einer Vorlage MeineVorlage ist Vorlage:MeineVorlage .
Before existing templates are significantly changed, the project should be briefly discussed or announced on the discussion page of the respective template.
Built-in variables[edit | edit source]
Jedes MediaWiki verfügt über eine Anzahl Eingebauter Variablen, die zwar keine Seiten im Namensraum "Vorlage:" sind, aber dennoch wie Vorlagen benutzt werden.
Beispielsweise ergibt die Variable Each MediaWiki has a number of Built-in Variables that are not pages in the "Template:" namespace, but are still used as templates.
The variable {{CURRENTTIME}} (die momentane current UTC -Zeit) derzeit den Wert time) for example returns the value 22:50.
Vorlagen bei Further notes[edit | edit source]
- The use of templates is basically a Transclusion. It is also possible to use pages that are not in the corresponding namespace as templates. However, this is to be done with caution, since some functions require that the pages are located in the template namespace.
- Templates can also be used to define the output of semantic queries. More information can be found here. (This is an example where the pages must be in the template namespace.)
Templates in BlueSpice[edit | edit source]
Interne LinksInternal links[edit | edit source]
- Vorhandene Vorlagen - die für die meisten Artikel-Autoren relevanten Vorlagen
- Alle Seiten des Namensraums Template - Alle Vorlagen-Seiten außer den eingebauten Variablen
- Hilfetext zu eingebauten Variablen
- All pages of the namespace Template - All template pages without built-in variables
Externe Links[edit | edit source]
==Was sind Vorlagen?== Vorlagen (engl: Templates) sind (Quell-)Textvorlagen, die in andere Seiten des Wikis eingebunden werden können. Dies hat zum einen den Sinn, öfter verwendete Bestandteile wie Briefvorlagen oder Checklisten auszulagern, um sie nicht jedes Mal neu erstellen zu müssen. Zum anderen kann mittels Vorlagen eine gewisse Einheitlichkeit gewährleistet werden. Darüber hinaus bietet die Verwendung von Vorlagen eine gewisse Flexibilität, da Änderungen zentral gemacht werden können und sich auf alle Seiten auswirken, die auf die Vorlage zugreifen. Dementsprechend sind mögliche Anwendungen für Vorlagen die Verwaltung von Mitteilungen, die Darstellung einheitlicher Navigationsbereiche oder einfach die Vereinheitlichung einer Gruppe von Seiten. ==Existierende Vorlagen benutzen== Eine Vorlage wird in einer Seite benutzt, indem man den Namen der Vorlage (also den Titel der Vorlagen-Seite, ohne den Namensraum "Vorlage:") in zwei geschweifte Klammern setzt: : <tt><nowiki>{{MeineVorlage}}</nowiki></tt> Eine solche Benutzung bewirkt, dass beim Aufrufen der benutzenden Seite der geklammerte Text durch den Quelltext der Vorlage ersetzt wird. Der Quelltext der benutzenden Seite enthält auch weiterhin den geklammerten Text, so dass künftige Änderungen der Vorlage sich auch auf bereits bestehende Benutzungen der Vorlage auswirken. Der Quelltext der Vorlage kann auch wahlweise bereits beim Abspeichern der Seite erzeugt werden, statt beim Aufrufen der Seite. Dazu wird die folgende Form verwendet: : <tt><nowiki>{{subst:MeineVorlage}}</nowiki></tt> Das kann sinnvoll sein, wenn ein initialer Text erzeugt werden soll, der später auf jeder neuen Seite geändert werden können soll. Für Vorlagen ist der Namensraum "{{ns:Template}}:" reserviert. Alle Seiten in diesem Namensraum werden als Vorlagen betrachtet, aber möglicherweise sind nicht alle diese Vorlagen für jeden Artikel-Autor auch relevant. Die komplette Liste aller Seiten in diesem Namensraum kann über die #REDIRECT [[Template]] ==What are templates?== Templates contain (source-)code, that can be included at different places of the wiki. On the one hand, it makes sense to outsource frequently used components such as letter templates or checklists so that they do not have to be recreated each time. Templates can also ensure some amount of consistency regarding content structure and styling. In addition, the use of templates offers some flexibility, as changes can be made centrally and affect all pages that access the template. Accordingly, possible applications for templates are the management of messages, the creation of uniform navigation areas or simply the unification of a group of pages. ==Creating new templates== A new template is created like an article page, only in the namespace '''template'''. Example: The whole page name of the template '''MyTemplate''' is '''Template:MyTemplate'''. <div class="bluebox">'''Hint:''' Please note that the names of templates are case-sensitive.</div> ==Usage of existing templates== You can use a template on a wiki page by putting the template name (without the namespace name) in double curly brackets: :<tt><nowiki>{{MyTemplate}}</nowiki></tt> Such use causes the bracketed text to be replaced by the source text of the template when the page being used is accessed. The source code of the using page still contains the bracketed text, so that future changes to the template will also affect existing uses of the template. The source code of the template can also be generated when the page is saved instead of when the page is called. The following form is used for this: :<tt><nowiki>{{subst:MyTemplate}}</nowiki></tt> This can be useful if you want to create an initial text that can later be changed on each new page. The namespace "{{ns:Template}}:" is reserved for templates. All pages in this namespace are considered templates, but not all of them may be relevant to every article author. A complete list of pages in that namespace can be seen on [{{SERVER}}/index.php?title=Spezial%3AAlle+SeitenSpecial%3AAllPages&from=&namespace=10| Spezialseite des Namensraums {{ns:Template}}] gezeigt werden. Die für die meisten Artikel-Autoren relevanten Vorlagen sind auf [[Vorhandene Vorlagen]] gelistet und erklärt. <div class="bluebox">'''Hinweis:''' Wenn eine Seite Vorlagen benutzt, werden diese im Edit-Modus unter dem Bearbeitungsfeld angezeigt.</div> ==Existierende Vorlagen editieren== Bevor existierende Vorlagen signifikant geändert werden, sollte auf der Diskussionsseite der jeweiligen Vorlage das Vorhaben kurz diskutiert oder angekündigt werden. ==Neue Vorlagen erstellen== Eine neue Vorlage wird ganz normal wie eine Artikel-Seite erstellt, nur eben im Namensraum '''Vorlage'''. Beispiel: Der vollständige Seitenname einer Vorlage '''MeineVorlage''' ist '''Vorlage:MeineVorlage''' . <div class="bluebox">'''Hinweis:''' Bitte beachten Sie, dass die Namen von Vorlagen "case-sensitive" sind, und somit Groß- und Kleinschreibung Auswirkungen haben.</div> ==Eingebaute Variablen== Jedes MediaWiki verfügt über eine Anzahl [[Eingebaute Variablen|Eingebauter Variablen]], die zwar keine Seiten im Namensraum "Vorlage:" sind, aber dennoch wie Vorlagen benutzt werden. Beispielsweise ergibt die Variable <tt><nowiki>{{CURRENTTIME}}</nowiki></tt> (die momentane UTC-Zeit) derzeit den Wert {{CURRENTTIME}}. ==Vorlagen bei BlueSpice== ===Interne Links=== * [[Vorhandene Vorlagen]] - die für die meisten Artikel-Autoren relevanten Vorlagen * [{{SERVER}}{{localurl:Spezial:Alle Seiten|namespace=10}} Alle Seiten des Namensraums {{ns:Template}}] - Alle Vorlagen-Seiten außer den eingebauten Variablen * [[Eingebaute Variablen|Hilfetext zu eingebauten Variablen]] ===Externe Links=== * [http://de.wikipedia.org/wiki/Vorlagen Hilfetext zu Vorlagen auf Wikipedia(de)] * special page of the namespace {{ns:Template}}]. ==Editing existing templates== Before existing templates are significantly changed, the project should be briefly discussed or announced on the discussion page of the respective template. ==Built-in variables== Each MediaWiki has a number of [[MagicWords/new|Built-in Variables]] that are not pages in the "Template:" namespace, but are still used as templates. The variable <tt><nowiki>{{CURRENTTIME}}</nowiki></tt> (current UTC time) for example returns the value {{CURRENTTIME}}. ==Further notes== *The use of templates is basically a [[Transclusion]]. It is also possible to use pages that are not in the corresponding namespace as templates. However, this is to be done with caution, since some functions require that the pages are located in the template namespace. *Templates can also be used to define the output of [https://www.semantic-mediawiki.org/wiki/Help:Inline_queries semantic queries]. More information can be found [https://www.semantic-mediawiki.org/wiki/Help:Template_format here]. (This is an example where the pages must be in the template namespace.) ==Templates in BlueSpice== ===Internal links=== *[{{SERVER}}{{localurl:Special:AllPages|namespace=10}} All pages of the namespace {{ns:Template}}] - All template pages without built-in variables ===Externe Links=== *[https://en.wikipedia.org/wiki/Help:Template Help text for templates on Wikipedia] *[http://meta.wikimedia.org/wiki/Help:Template Hilfetext zu Vorlagen auf WikiMedia (engl.)] [[Category:MediaWiki]] [[en:{{FULLPAGENAME}}]]Help text for templates on WikiMedia] [[en:{{FULLPAGENAME}}]] [[de:Vorlagen]]
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | #REDIRECT [[Template]] | |
− | |||
− | == | + | ==What are templates?== |
− | + | Templates contain (source-)code, that can be included at different places of the wiki. On the one hand, it makes sense to outsource frequently used components such as letter templates or checklists so that they do not have to be recreated each time. Templates can also ensure some amount of consistency regarding content structure and styling. In addition, the use of templates offers some flexibility, as changes can be made centrally and affect all pages that access the template. Accordingly, possible applications for templates are the management of messages, the creation of uniform navigation areas or simply the unification of a group of pages. | |
− | + | ==Creating new templates== | |
− | + | A new template is created like an article page, only in the namespace '''template'''. | |
− | |||
− | : | + | Example: The whole page name of the template '''MyTemplate''' is '''Template:MyTemplate'''. |
− | |||
− | + | <div class="bluebox">'''Hint:''' Please note that the names of templates are case-sensitive.</div> | |
− | |||
− | |||
− | |||
− | == | + | ==Usage of existing templates== |
− | + | You can use a template on a wiki page by putting the template name (without the namespace name) in double curly brackets: | |
− | + | :<tt><nowiki>{{MyTemplate}}</nowiki></tt> | |
− | + | Such use causes the bracketed text to be replaced by the source text of the template when the page being used is accessed. The source code of the using page still contains the bracketed text, so that future changes to the template will also affect existing uses of the template. | |
− | + | The source code of the template can also be generated when the page is saved instead of when the page is called. The following form is used for this: | |
− | |||
− | + | :<tt><nowiki>{{subst:MyTemplate}}</nowiki></tt> | |
− | == | + | This can be useful if you want to create an initial text that can later be changed on each new page. |
− | === | + | |
− | * [[ | + | The namespace "{{ns:Template}}:" is reserved for templates. All pages in this namespace are considered templates, but not all of them may be relevant to every article author. A complete list of pages in that namespace can be seen on [{{SERVER}}/index.php?title=Special%3AAllPages&from=&namespace=10| special page of the namespace {{ns:Template}}]. |
− | * [{{SERVER}}{{localurl: | + | |
− | + | ||
+ | ==Editing existing templates== | ||
+ | Before existing templates are significantly changed, the project should be briefly discussed or announced on the discussion page of the respective template. | ||
+ | |||
+ | |||
+ | ==Built-in variables== | ||
+ | Each MediaWiki has a number of [[MagicWords/new|Built-in Variables]] that are not pages in the "Template:" namespace, but are still used as templates. | ||
+ | |||
+ | The variable <tt><nowiki>{{CURRENTTIME}}</nowiki></tt> (current UTC time) for example returns the value {{CURRENTTIME}}. | ||
+ | |||
+ | ==Further notes== | ||
+ | |||
+ | *The use of templates is basically a [[Transclusion]]. It is also possible to use pages that are not in the corresponding namespace as templates. However, this is to be done with caution, since some functions require that the pages are located in the template namespace. | ||
+ | *Templates can also be used to define the output of [https://www.semantic-mediawiki.org/wiki/Help:Inline_queries semantic queries]. More information can be found [https://www.semantic-mediawiki.org/wiki/Help:Template_format here]. (This is an example where the pages must be in the template namespace.) | ||
+ | |||
+ | |||
+ | ==Templates in BlueSpice== | ||
+ | ===Internal links=== | ||
+ | |||
+ | *[{{SERVER}}{{localurl:Special:AllPages|namespace=10}} All pages of the namespace {{ns:Template}}] - All template pages without built-in variables | ||
===Externe Links=== | ===Externe Links=== | ||
− | * [ | + | |
− | * [http://meta.wikimedia.org/wiki/Help:Template | + | *[https://en.wikipedia.org/wiki/Help:Template Help text for templates on Wikipedia] |
− | + | *[http://meta.wikimedia.org/wiki/Help:Template Help text for templates on WikiMedia] | |
− | [[en:{{FULLPAGENAME}}]][[de:Vorlagen]] | + | |
+ | [[en:{{FULLPAGENAME}}]] | ||
+ | [[de:Vorlagen]] |