Difference between revisions of "Wiki tweak page"
From Manjaro
Views
Actions
Namespaces
Variants
Tools
(Fix formatting - removed unnecessary emphasizing) |
(Fix formatting - removed unnecessary emphasizing and whitespace) |
||
Line 1: | Line 1: | ||
== How to create templates == | == How to create templates == | ||
{{BoxWarning|If you feel a template is missing or needs improvement?|Use the '''Talk''' link and discuss the change with your fellow editors. | |||
<p>Before creating new templates the existing [[Help:Template|Template collection]] and preferably use one of them.</p>}} | |||
Create a new page to serve as base | |||
Example: <nowiki>http://wiki.manjaro.org/index.php/Template:TemplateNameBase</nowiki> | Example: <nowiki>http://wiki.manjaro.org/index.php/Template:TemplateNameBase</nowiki> | ||
After creating the page, edit it by taking the code below as example | |||
<pre><noinclude>{{Template}}</noinclude> | |||
<includeonly>{{Box|{{{1}}}|{{{2}}}|#rgb|#rgb}}</includeonly></pre> | |||
Template arguments explained | |||
- rgb is the hex code for the border's color. | |||
- rgb is the hex code for the background color. | |||
- Box is the template where these templates take their formatting. | |||
Save your Template Base page and create a new page. | |||
Example: <nowiki>http://wiki.manjaro.org/index.php/Template:TemplateName</nowiki> | Example: <nowiki>http://wiki.manjaro.org/index.php/Template:TemplateName</nowiki> | ||
After creating the page, edit it and use below code as example | |||
<pre><noinclude>{{Template}}</noinclude> | |||
<includeonly>{{TemplateNameBase|TemplateName:|{{{1|{{Purpose}}}}}}}</includeonly></pre> | |||
Always preview your changes and fix bugs before you finally save the new template | |||
===Usage=== | ===Usage=== | ||
<nowiki>{{TemplateName|Text here}}</nowiki> | <nowiki>{{TemplateName|Text here}}</nowiki> | ||
Revision as of 10:33, 2 October 2020
How to create templates
Create a new page to serve as base
Example: http://wiki.manjaro.org/index.php/Template:TemplateNameBase
After creating the page, edit it by taking the code below as example
<noinclude>{{Template}}</noinclude> <includeonly>{{Box|{{{1}}}|{{{2}}}|#rgb|#rgb}}</includeonly>
Template arguments explained
- rgb is the hex code for the border's color. - rgb is the hex code for the background color. - Box is the template where these templates take their formatting.
Save your Template Base page and create a new page.
Example: http://wiki.manjaro.org/index.php/Template:TemplateName
After creating the page, edit it and use below code as example
<noinclude>{{Template}}</noinclude> <includeonly>{{TemplateNameBase|TemplateName:|{{{1|{{Purpose}}}}}}}</includeonly>
Always preview your changes and fix bugs before you finally save the new template
Usage
{{TemplateName|Text here}}