Difference between revisions of "Help:Template"

Added information on the file content template
m
(Added information on the file content template)
Line 13: Line 13:
You can utilize different boxtypes setting both the header and the content
You can utilize different boxtypes setting both the header and the content


{{BoxPrimary|Header|This is a BoxPrimary template}}{{BoxSecondary|Header|This is a BoxSecondary template}}{{BoxInfo|Header|This is a BoxInfo template}}{{BoxSuccess|Header|This is a BoxSuccess template}}{{BoxWarning|Header|This is a BoxWarning template}}{{BoxDanger|Header|This is a BoxDanger template}}{{BoxLight|Header|This is a BoxLight template}}{{BoxDark|Header|This is a BoxDark template}}
{{BoxPrimary|Header|This is a BoxPrimary template}}
{{BoxSecondary|Header|This is a BoxSecondary template}}
{{BoxInfo|Header|This is a BoxInfo template}}
{{BoxSuccess|Header|This is a BoxSuccess template}}
{{BoxWarning|Header|This is a BoxWarning template}}
{{BoxDanger|Header|This is a BoxDanger template}}
{{BoxLight|Header|This is a BoxLight template}}
{{BoxDark|Header|This is a BoxDark template}}
 
The same can be done when you need to describe how to modify an given file's content. This is a little more work but produces a nice result. Because the content of configuration file often if not always include '''=''' it is need to use named variables when passing values to the template.
 
<pre>{{File|file=Filename|content=Content}}</pre>
 
The best result is achieved by using the '''pre''' inside the content.
 
{{File|file=~/.profile|
content=
<pre>
# set PATH so it includes user's private bin if it exists
export QT_QPA_PLATFORMTHEME="qt5ct"
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
 
export EDITOR=/usr/bin/nano
export VISUAL=/usr/bin/nano
</pre>
}}
Moderators, translator
455

edits