Template:Box: Difference between revisions

From KDE Community Wiki
(New Template:Box)
 
(copy from userbase)
Line 1: Line 1:
<noinclude>
<div class="alert {{#if: {{{4| }}} | {{{4}}} | alert-warning }} d-flex">
{{Template}}
{{#if: {{{3|}}} | <div class="mr-3">{{{3}}}</div> }}
 
<div>
Included content begins
<div class="alert-heading">{{{2}}}</div>
----
<div>{{{1}}}</div>
</noinclude>
</div>
<div class="rbroundbox" style="width:{{{3|400px}}}; float:{{{3|center}}}"><div class="rbtopwrap"><div class="rbtop"><div></div></div>{{{1}}}</div>
<div class="rbcontent">{{{2}}}</div><!-- /rbcontent -->
<div class="rbbot"><div></div></div>
</div>
</div>
<noinclude>
<noinclude>
----
----
Included content ends
Use this template for content that needs to be specially emphasized. Syntax: {{Input|1=<nowiki>{{Box1|2=Title|3=Image|4=color|1=text}}</nowiki>}}
</noinclude>
 
The template takes four arguments:
# The text of the main body of the box
# The title of the box
# An image file to be displayed in the top left of the box - the image size should be 40 x 40 (optional)
# The background color (optional): possible values
#* default 'alert-warning' is yellow
#* ''alert-info'' gives blue - use with care; it doesn't work well with links
#* ''alert-success'' gives green
#* ''alert-error'' gives red
 
Example: {{Input|1=<nowiki>{{Box|2=Example|3=[[Image:Dialog-information.png|left|40px|link=]]|1=This is an example box}}</nowiki>}}
{{Box|2=Example|3=[[Image:Dialog-information.png|40px|link=]]|1=This is an example box}}
 
Please avoid using this template directly in pages. If you need something that doesn't already exist, consider making a new template based on this template. That way it will be much easier to maintain TechBase, and the risk of introducing unintended effects on your page is reduced considerably.
 
Existing templates based on this template: [[Template:Info]], [[Template:Note]], [[Template:Tip]], [[Template:Warning]], [[Template:Remember]].
 
[[Category:Template]]

Revision as of 10:21, 27 July 2019

{{{2}}}
{{{1}}}

Use this template for content that needs to be specially emphasized. Syntax:

{{Box1|2=Title|3=Image|4=color|1=text}}

The template takes four arguments:

  1. The text of the main body of the box
  2. The title of the box
  3. An image file to be displayed in the top left of the box - the image size should be 40 x 40 (optional)
  4. The background color (optional): possible values
    • default 'alert-warning' is yellow
    • alert-info gives blue - use with care; it doesn't work well with links
    • alert-success gives green
    • alert-error gives red

Example:

{{Box|2=Example|3=[[Image:Dialog-information.png|left|40px|link=]]|1=This is an example box}}
Example
This is an example box


Please avoid using this template directly in pages. If you need something that doesn't already exist, consider making a new template based on this template. That way it will be much easier to maintain TechBase, and the risk of introducing unintended effects on your page is reduced considerably.

Existing templates based on this template: Template:Info, Template:Note, Template:Tip, Template:Warning, Template:Remember.