Difference between revisions of "Template:Banner"

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


[[File:{{{image}}}|left|frameless|link=]]

Template for MediaWiki/Homepage redesign. The CSS is in MediaWiki:Gadget-site.css. See also Template:Full-width image.

Template for full-width images with inset text.

Template

This template creates an intro banner on a page. The banner should contain an image (optional), a title and 2-3 lines of text.

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

screenshot of banner template
Banner examples

The following parameters can be set in visual editing mode:

requiredno descriptionno descriptionUnknownno descriptionUnknownno descriptionUnknownshort quote

Template parameters

Parameter Description Type Status
Image name banner-image

Image name, without the File: prefix

Default
empty
Example
Example.png
empty
Auto value
empty
File optional Title title
Image width image-width

Width in pixels. Default setting is 200

Default
empty
Example
empty
Auto value
empty
Number optional
Heading banner-title

Text heading

Default
empty
Example
empty
Auto value
empty
String optional Section section suggested
Text banner-text

1-3 lines of text

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

Default is grey (#efefef). Replace with any hex value, (e.g. #ffffe6)

Default
empty
Example
empty
Auto value
empty
String optional Direction direction
Padding of the container box boxpadding

Sets the padding for the box in pixels. Default is 20.

Default
empty
Example
empty
Auto value
empty
Number optional Section-id section-id
Content padding contentpadding

Text padding independent from box padding. Default is 0.

Default
empty
Example
empty
Auto value
empty
Number optional Short quote
Vertical alignment of the box content boxalignitems

no description

Default
empty
Example
start, center
Auto value
empty
String optional
Title margin titlemargin

Allows to customize the margin of the title (e.g,. 0px 0px 0px 0px)

Default
empty
Example
empty
Auto value
empty
Unknown optional
<!--
                
                <includeonly><templatestyles src="Banner/styles.css" /><div class="banner-image nomobilebannerbox" style="align-items:{{{boxalignitems|start}}}; background:{{{boxbgcolor|#efefef}}}; padding:{{{boxpadding|20}}}px">
        <div class="banner-box banner-box-{{{direction}}}">
            <div class="name">{{{title}}}</div>
            <div class="type">{{{section}}}</div>
            </div>
            
            -->
            <!--</div>-->
            <div class="portal-bannerbox">
            <h1>{{{banner-title|}}}</h1>
            
            [[File:{{{image}}}|left|frameless|link=]]
            
            {{#if:{{{short quote|}}}|<div class="portal-shortquote">{{{short quote}}}</div>}}
            </div>
            <noinclude>
            

            Template for [[MediaWiki/Homepage redesign]]. The CSS is in [[MediaWiki:Gadget-site.css]].
            
            See also [[Template:Full-width image]].
            
<templatedata>
            
            {
            
                "params": {
            
                           "direction": {},
            
                    "title": {
            
                        "type": "string",
            
                        "required": false
            
                    },
            
                    "section": {},
            
                    "image": {
            
                        "description": "Image name, without the File: prefix",
            
                        "example": "Example.png",
            
                        "required": true,
            
                        "type": "wiki-file-name"
            
                    },
            
                    "section-id": {},
            
                    "short quote": {}
            
                },
            
                "description": "Template for full-width images with inset text.",
            
                "paramOrder": [
            
                    "image",
            
                    "title",
            
                    "section",
            
                    "direction",
            
                    "section-id",
            
                    "short quote"
            
                ]
            {{#if:{{{banner-image|}}}|<div class="banner-image">[[File:{{{banner-image}}}|left|{{{image-width|200}}}x{{{image-width|200}}}px|link=]]</div>|}}<div class="banner-content" style="padding:{{{contentpadding|0}}}px;">{{#if:{{{banner-title|}}}|<div class="banner-title"><h1 style="margin:{{{titlemargin|margin:12px 0 0 0; }}}>{{{banner-title}}}</h1></div>|}}{{#if:{{{banner-text|}}}|<div class="banner-text">{{{banner-text}}}</div>|}}</div></div></includeonly><noinclude>
            
            This template creates an intro banner on a page. The banner should contain an image (optional), a title and 2-3 lines of text.
            

            The template files (''Template:Banner'' and ''Template:Banner/styles.css'' can be downloaded as part of the [[Manual:Template/Template package|template package]].
            
            [[File:template-download-Banner.PNG|550x550px|center|alt=screenshot of banner template|thumb|Banner examples]]
            
<templatedata>
            
            {
            
            	"params": {
            
            		"banner-image": {
            
            			"description": "Image name, without the File: prefix",
            
            			"type": "wiki-file-name",
            
            			"label": "Image name"
            
            		},
            
            		"banner-title": {
            
            			"type": "string",
            
            			"suggested": true,
            
            			"label": "Heading",
            
            			"description": "Text heading"
            
            		},
            
            		"banner-text": {
            
            			"label": "Text",
            
            			"description": "1-3 lines of text",
            
            			"type": "content"
            
            		},
            
            		"boxbgcolor": {
            
            			"label": "Background color",
            
            			"description": "Default is grey (#efefef). Replace with any hex value, (e.g. #ffffe6)",
            
            			"type": "string"
            
            		},
            
            		"boxpadding": {
            
            			"label": "Padding of the container box",
            
            			"description": "Sets the padding for the box in pixels. Default is 20.",
            
            			"type": "number"
            
            		},
            
            		"contentpadding": {
            
            			"label": "Content padding",
            
            			"description": "Text padding independent from box padding. Default is 0.",
            
            			"type": "number"
            
            		},
            
            		"image-width": {
            
            			"label": "Image width",
            
            			"description": "Width in pixels. Default setting is 200",
            
            			"type": "number"
            
            		},
            
            		"boxalignitems": {
            
            			"label": "Vertical alignment of the box content",
            
            			"example": "start, center",
            
            			"type": "string"
            
            		},
            
            		"titlemargin": {
            
            			"label": "Title margin",
            
            			"description": "Allows to customize the margin of the title (e.g,. 0px 0px 0px 0px)"
            
            		}
            
            	},
            
            	"paramOrder": [
            
            		"banner-image",
            
            		"image-width",
            
            		"banner-title",
            
            		"banner-text",
            
            		"boxbgcolor",
            
            		"boxpadding",
            
            		"contentpadding",
            
            		"boxalignitems",
            
            		"titlemargin"
            
            	],
            
            	"description": "The following parameters can be set in visual editing mode:"
            }
        </templatedata>
        </noinclude>
Line 1: Line 1:
 +
<!--
 +
<div class="banner-image nomobile">
 +
<div class="banner-box banner-box-{{{direction}}}">
 +
<div class="name">{{{title}}}</div>
 +
<div class="type">{{{section}}}</div>
 +
</div>
 +
-->
 +
<!--</div>-->
 +
<div class="portal-bannerbox">
 +
<h1>{{{banner-title|}}}</h1>
 +
[[File:{{{image}}}|left|frameless|link=]]
 +
{{#if:{{{short quote|}}}|<div class="portal-shortquote">{{{short quote}}}</div>}}
 +
</div>
 +
<noinclude>
  
<includeonly><templatestyles src="Banner/styles.css" /><div class="bannerbox" style="align-items:{{{boxalignitems|start}}}; background:{{{boxbgcolor|#efefef}}}; padding:{{{boxpadding|20}}}px">
+
Template for [[MediaWiki/Homepage redesign]]. The CSS is in [[MediaWiki:Gadget-site.css]].
{{#if:{{{banner-image|}}}|<div class="banner-image">[[File:{{{banner-image}}}|left|{{{image-width|200}}}x{{{image-width|200}}}px|link=]]</div>|}}<div class="banner-content" style="padding:{{{contentpadding|0}}}px;">{{#if:{{{banner-title|}}}|<div class="banner-title"><h1 style="margin:{{{titlemargin|margin:12px 0 0 0; }}}>{{{banner-title}}}</h1></div>|}}{{#if:{{{banner-text|}}}|<div class="banner-text">{{{banner-text}}}</div>|}}</div></div></includeonly><noinclude>
+
See also [[Template:Full-width image]].
This template creates an intro banner on a page. The banner should contain an image (optional), a title and 2-3 lines of text.
 
 
 
The template files (''Template:Banner'' and ''Template:Banner/styles.css'' can be downloaded as part of the [[Manual:Template/Template package|template package]].
 
[[File:template-download-Banner.PNG|550x550px|center|alt=screenshot of banner template|thumb|Banner examples]]
 
  
 
<templatedata>
 
<templatedata>
 
{
 
{
"params": {
+
    "params": {
"banner-image": {
+
              "direction": {},
"description": "Image name, without the File: prefix",
+
        "title": {
"type": "wiki-file-name",
+
            "type": "string",
"label": "Image name"
+
            "required": false
},
+
        },
"banner-title": {
+
        "section": {},
"type": "string",
+
        "image": {
"suggested": true,
+
            "description": "Image name, without the File: prefix",
"label": "Heading",
+
            "example": "Example.png",
"description": "Text heading"
+
            "required": true,
},
+
            "type": "wiki-file-name"
"banner-text": {
+
        },
"label": "Text",
+
        "section-id": {},
"description": "1-3 lines of text",
+
        "short quote": {}
"type": "content"
+
    },
},
+
    "description": "Template for full-width images with inset text.",
"boxbgcolor": {
+
    "paramOrder": [
"label": "Background color",
+
        "image",
"description": "Default is grey (#efefef). Replace with any hex value, (e.g. #ffffe6)",
+
        "title",
"type": "string"
+
        "section",
},
+
        "direction",
"boxpadding": {
+
        "section-id",
"label": "Padding of the container box",
+
        "short quote"
"description": "Sets the padding for the box in pixels. Default is 20.",
+
    ]
"type": "number"
 
},
 
"contentpadding": {
 
"label": "Content padding",
 
"description": "Text padding independent from box padding. Default is 0.",
 
"type": "number"
 
},
 
"image-width": {
 
"label": "Image width",
 
"description": "Width in pixels. Default setting is 200",
 
"type": "number"
 
},
 
"boxalignitems": {
 
"label": "Vertical alignment of the box content",
 
"example": "start, center",
 
"type": "string"
 
},
 
"titlemargin": {
 
"label": "Title margin",
 
"description": "Allows to customize the margin of the title (e.g,. 0px 0px 0px 0px)"
 
}
 
},
 
"paramOrder": [
 
"banner-image",
 
"image-width",
 
"banner-title",
 
"banner-text",
 
"boxbgcolor",
 
"boxpadding",
 
"contentpadding",
 
"boxalignitems",
 
"titlemargin"
 
],
 
"description": "The following parameters can be set in visual editing mode:"
 
 
}
 
}
 
</templatedata>
 
</templatedata>
 
</noinclude>
 
</noinclude>

Attachments

Discussions