Help:Templates: Difference between revisions

Jump to navigation Jump to search
Sectioning + Another secret to advanced editing
(Completely rewritten the text. This is now a help page, though there is still a bit more to do)
(Sectioning + Another secret to advanced editing)
Line 67: Line 67:
Always try to add documentation to templates missing that, preferably using {{tl|informative template}}.
Always try to add documentation to templates missing that, preferably using {{tl|informative template}}.


=== Translating templates ===
== Translating templates ==
Translating templates is different from translating normal articles.  All translations are written within one and the same template.  To do that one can use the {{tl|LangSwitch}} template.
Translating templates is different from translating normal articles.  All translations are written within one and the same template.  To do that one can use the {{tl|LangSwitch}} template.


Line 78: Line 78:


While this page will not go into details, there is a few secrets to more advanced templates:
While this page will not go into details, there is a few secrets to more advanced templates:
;Tables:  Wiki tables are tricky to understand, but can do a lot for any kind of box template and small layouts.
;Magic words:  Magic words at first look like templates except for that they mostly are all uppercase.  One of them for example is <tt><nowiki>{{PAGENAME}}</nowiki></tt>, another one is <tt><nowiki>__NOTOC__</nowiki></tt>.
;Magic words:  Magic words at first look like templates except for that they mostly are all uppercase.  One of them for example is <tt><nowiki>{{PAGENAME}}</nowiki></tt>, another one is <tt><nowiki>__NOTOC__</nowiki></tt>.
;Parser functions:  Parser functions allow more or less regular programming with conditionals, switches, string formatting etc.  A good hint is that well placed empty html comments can make the code way more readable.
;Parser functions:  Parser functions allow more or less regular programming with conditionals, switches, string formatting etc.  A good hint is that well placed empty html comments can make the code way more readable.

Navigation menu