Difference between revisions of "Template:Box"
Jump to navigation
Jump to search
(Added a basic "box" template to the wiki, to be used as a base for other templates. Similarly to how they are used on Wikipedia, such templates can be used to display e.g. a warning on a page.) |
m (Changed icon size to 36px) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | __NOTOC__ |
+ | __NOTOC__<noinclude> |
− | <noinclude> |
||
− | = Template:Box = |
||
'''Template:Box''' is a general-purpose template meant to display Wikipedia-style boxes with information such as warnings about the content of a page. |
'''Template:Box''' is a general-purpose template meant to display Wikipedia-style boxes with information such as warnings about the content of a page. |
||
+ | More specific box templates include: |
||
− | See the [[Template:Outdated]] template for an example of its usage. |
||
+ | * [[Template:TipBox]], for displaying '''notices''', '''tips''' and '''miscellaneous information'''; |
||
+ | * [[Template:WarningBox]], for displaying '''warnings''' and '''important notes'''; |
||
+ | * [[Template:SafeBox]], for displaying '''validating information''' (e.g. see [[Template:Applicable to TDE]]). |
||
+ | These more specific templates should be preferred when possible to directly using this template. |
||
− | To use this template, use <code><nowiki>{{Box|caption|text|color1|color2}}</nowiki></code> on the target page (where <code>caption</code> is the box caption, <code>text</code> is the box contents, <code>color1</code> is the background colour and <code>color2</code> is the highlight colour. |
||
⚫ | |||
+ | == Usage == |
||
⚫ | |||
+ | |||
− | </noinclude> |
||
+ | To use this template, use <code><nowiki>{{Box|caption=...|text=...|icon=...|background=...|highlight=...}}</nowiki></code> on the target page. |
||
− | <includeonly> |
||
+ | * <code>caption</code> ''(optional)'' is the box caption; |
||
− | <div style='background-color: {{{3}}}; border: solid 2px {{{4}}}; border-left: solid 5px {{{4}}}; padding: 2px 5px;'> |
||
+ | * <code>text</code> ''(required)'' is the box contents; |
||
− | <div style='font-size:1.15em; font-weight: bold;'>{{{1}}}</div> |
||
+ | * <code>icon</code> ''(optional)'' is the icon displayed by the text (default: [[:File:Gear.png]]); |
||
− | {{{2}}} |
||
+ | * <code>background</code> ''(optional)'' is the background color (default: <tt>gainsboro</tt>); |
||
− | </div> |
||
+ | * <code>highlight</code> ''(optional)'' is the highlight color (default: <tt>gray</tt>). |
||
− | </includeonly> |
||
+ | |||
+ | Using this template on a page results in a box being placed. |
||
+ | |||
+ | == Examples == |
||
+ | |||
+ | |||
+ | <syntaxhighlight lang="html+handlebars"> |
||
+ | {{Box |
||
+ | |caption=Hello, TDE Wiki! |
||
+ | |text=This is a box. |
||
+ | }} |
||
+ | </syntaxhighlight> |
||
+ | |||
+ | {{Box |
||
+ | |caption=Hello, TDE Wiki! |
||
+ | |text=This is a box. |
||
+ | }} |
||
+ | |||
+ | |||
+ | ---- |
||
+ | |||
+ | <syntaxhighlight lang="html+handlebars"> |
||
+ | {{Box |
||
+ | |caption=Welcome to the Trinity Desktop Project Wiki! |
||
⚫ | |||
+ | |icon=TDE Logo.png |
||
+ | |background=#ABCBF0 |
||
+ | |highlight=#4C8ACE |
||
+ | }} |
||
+ | </syntaxhighlight> |
||
+ | |||
+ | {{Box |
||
+ | |caption=Welcome to the Trinity Desktop Project Wiki! |
||
⚫ | |||
+ | |icon=TDE Logo.png |
||
+ | |background=#ABCBF0 |
||
+ | |highlight=#4C8ACE |
||
+ | }} |
||
+ | </noinclude><includeonly><div style="background: {{{background|gainsboro}}}; display: flex; border: solid 1px black; min-height: 36px; margin: 5px 0;"> |
||
+ | <div style="padding: 8px 5px; background: linear-gradient(to right, {{{highlight|gray}}}, {{{background|gainsboro}}});">[[File:{{{icon|Gear.png}}}|link=|36px]]</div><div style="padding: 2px 5px; flex-grow: 1;"><div style="font-size:1.15em; font-weight: bold; border-bottom: dotted 1px #000000;">{{{caption}}}</div>{{{text}}}</div></div></includeonly> |
Latest revision as of 13:48, 21 April 2022
Template:Box is a general-purpose template meant to display Wikipedia-style boxes with information such as warnings about the content of a page.
More specific box templates include:
- Template:TipBox, for displaying notices, tips and miscellaneous information;
- Template:WarningBox, for displaying warnings and important notes;
- Template:SafeBox, for displaying validating information (e.g. see Template:Applicable to TDE).
These more specific templates should be preferred when possible to directly using this template.
Usage
To use this template, use {{Box|caption=...|text=...|icon=...|background=...|highlight=...}}
on the target page.
caption
(optional) is the box caption;text
(required) is the box contents;icon
(optional) is the icon displayed by the text (default: File:Gear.png);background
(optional) is the background color (default: gainsboro);highlight
(optional) is the highlight color (default: gray).
Using this template on a page results in a box being placed.
Examples
Hello, TDE Wiki!
This is a box.
Welcome to the Trinity Desktop Project Wiki!
The Trinity Desktop Environment (TDE) project is a feature rich desktop environment for Unix-like operating systems with a primary goal of retaining a traditional, efficient and productive user interface.