Manjaro Difference between revisions of "Wiki tweak page"

Difference between revisions of "Wiki tweak page"

From Manjaro
imported>Aeonflux
(Marked this version for translation)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= How to create templates =
<languages/>
__TOC__
<translate>
== How to create templates == <!--T:1-->
{{BoxWarning|If you feel a template is missing or needs improvement?|Use this [[Talk:Wiki_tweak_page|Discussion 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>


=== The creation process ===
<!--T:2-->
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>


; 1. You will have to create a new page.
<!--T:3-->
Example: <nowiki>http://wiki.manjaro.org/index.php/Template:TemplateNameBase</nowiki>
Template arguments explained
; 2. After creating the page, edit it by taking the code below as example:
 
{{optname|<nowiki><includeonly>{{Box|{{{1}}}|{{{2}}}|#XXXX|#YYYY}}</includeonly></nowiki>}}
<!--T:4-->
:''XXXX'' is the hex code for the border's color.
- rgb is the hex code for the border's color.
:''YYYY'' is the hex code for the background color.
- rgb is the hex code for the background color.
:''Box'' is the template where these templates take their formatting.
- Box is the template where these templates take their formatting.
; 3. Save your Template Base page.
 
; 4. Create a new page.
<!--T:5-->
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>
; 5. After creating the page, edit it by taking the code below as example:
{{optname|<nowiki><includeonly>{{TemplateNameBase|TemplateName:|{{{1|{{Purpose}}}}}}}</includeonly></nowiki>}}
; 6. Save your Template page.


== Using the new template ==
<!--T:6-->
After creating the page, edit it and use below code as example
<pre><noinclude>{{Template}}</noinclude>
<includeonly>{{TemplateNameBase|TemplateName:|{{{1|{{Purpose}}}}}}}</includeonly></pre>


'''Usage:'''
<!--T:7-->
Always preview your changes and fix bugs before you finally save the new template


===Usage=== <!--T:8-->
<nowiki>{{TemplateName|Text here}}</nowiki>
<nowiki>{{TemplateName|Text here}}</nowiki>
 
</translate>
'''Output:'''
[[Category:Contents Page{{#translation:}}]]
{{optname|TemplateName:Text here}}

Latest revision as of 19:14, 7 September 2021

Other languages:
English • ‎Türkçe • ‎русский

How to create templates

If you feel a template is missing or needs improvement?
Use this Discussion link and discuss the change with your fellow editors.

Before creating new templates the existing Template collection and preferably use one of them.

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}}

Cookies help us deliver our services. By using our services, you agree to our use of cookies.