Difference between revisions of "Template:Banner"
(Tag: 2017 source edit) |
m (Tag: 2017 source edit) |
The template files (Template:Banner and Template:Banner/styles.css can be downloaded as part of the template package.
The following parameters can be set in visual editing mode:
Template[[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.
| Parameter | Description | Type | Status | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Image name | banner-image |
Image name, without the File: prefix
|
File | optionalrequired | |||||
| Image width |
image-width
|
Width in pixels. Default setting is 200
|
Number | optional | |||||
| Heading |
banner-title
|
Text headingTitle |
title
|
no description
|
String | suggested | |||
| Text |
banner-text
|
1-3 lines of text
|
Content | optional | |||||
| Background color |
boxbgcolor
|
Default is grey (#efefef). Replace with any hex value, (e.g. #ffffe6)optional | |||||||
| Section |
section
|
no description
|
StringUnknown | optional | Padding of the container box |
boxpadding
|
Sets the padding for the box in pixels. Default is 20.
|||
| Direction |
direction
|
no description
|
NumberUnknown | optional | Content padding |
contentpadding
|
|||
| Section-id |
section-id
|
no description
|
NumberUnknown | optional | Vertical alignment of the box content | ||||
| Short quote | short quote |
no description
|
String | optional | Title margin |
titlemargin
|
|
Unknown | optional |
<includeonly><templatestyles src="Banner/styles.css" /><!-- <div class="bannerbox" style="align-items:{{{boxalignitems|start}}}; background:{{{boxbgcolor|#efefef}}}; padding:{{{boxpadding|20}}}pxbanner-image nomobile"> {{#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:" <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" ] } </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> | ||
| − | + | Template for [[MediaWiki/Homepage redesign]]. The CSS is in [[MediaWiki:Gadget-site.css]]. | |
| − | + | See also [[Template:Full-width image]]. | |
| − | |||
| − | |||
| − | |||
| − | [[ | ||
<templatedata> | <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" | |
| − | + | ] | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
} | } | ||
</templatedata> | </templatedata> | ||
</noinclude> | </noinclude> | ||