Difference between revisions of "Template:Box Note"

(Tag: 2017 source edit)
(Tag: 2017 source edit)
 


This template creates different types of info boxes on a page. Based on the box type, the label and the color scheme are selected.

The template files (Template:Box Note and Template:Box Note/styles.css can be downloaded as part of the template package.

screenshot of box note template
Info box examples


To add standard infoboxes such as notes or related links to a page

Template parameters

Parameter Description Type Status
Type of box boxtype

Possible values: note, tip, warning, important, example, backgroundbox. If type backgroundbox is chosen, then no label is added before the message.

Default
note
Example
note
Auto value
empty
String required
Text message Note text

no description

Default
empty
Example
empty
Auto value
empty
Content optional
Background color bgcolor

Changes the background color of the box.

Default
empty
Example
empty
Auto value
empty
String optional
<includeonly><div class="infobox notification-{{{boxtype}}}" {{#if:{{{bgcolor|}}}|style="background:{{{bgcolor}}}"|}}>
        <span class="boxlabel">
        
        {{#switch: {{{boxtype}}}
        
         | note = Note:
        
         | tip = Tip:
        
         | warning = Warning:
        
         | example = Example:
        
         | important = Important!
        
         | backgroundbox =
        
         | #default = Note:
        
        }}
        </span>{{{Note text}}}
        </div></includeonly>
        <noinclude>
        
        This template creates different types of info boxes on a page. Based on the box type, the label and the color scheme are selected.
        

        The template files (''Template:Box Note'' and ''Template:Box Note/styles.css'' can be downloaded as part of the [[Manual:Template/Template package|template package]].
        

            [[File:template-download-Box Note.png|550x550px|center|alt=screenshot of box note template|thumb|Info box examples]]
        
<templatedata>
        
        {
        
        	"params": {
        
        		"boxtype": {
        
        			"description": "Possible values: note, tip, warning, important, example, backgroundbox.  If type backgroundbox is chosen, then no label is added before the message.",
        
        			"example": "note",
        
        			"type": "string",
        
        			"default": "note",
        
        			"required": true,
        
        			"label": "Type of box"
        
        		},
        
        		"Note text": {
        
        			"label": "Text message",
        
        			"type": "content"
        
        		},
        
        		"bgcolor": {
        
        			"label": "Background color",
        
        			"description": "Changes the background color of the box.",
        
        			"type": "string"
        
        		}
        
        	},
        
        	"description": "To add standard infoboxes such as notes or related links to a page"
        
        }
        </templatedata>
        </noinclude>
Line 16: Line 16:
  
 
The template files (''Template:Box Note'' and ''Template:Box Note/styles.css'' can be downloaded as part of the [[Manual:Template/Template package|template package]].
 
The template files (''Template:Box Note'' and ''Template:Box Note/styles.css'' can be downloaded as part of the [[Manual:Template/Template package|template package]].
 +
  
 
[[File:template-download-Box Note.png|550x550px|center|alt=screenshot of box note template|thumb|Info box examples]]
 
[[File:template-download-Box Note.png|550x550px|center|alt=screenshot of box note template|thumb|Info box examples]]

Attachments

Discussions