Difference between revisions of "Template:Pagebanner"

From Northumberland Climbing
Jump to navigation Jump to search
(Replaced content with "<templatestyles src="Pagebanner/styles.css"/>")
Tags: 2017 source edit Replaced
Tag: 2017 source edit
Line 1: Line 1:
<templatestyles src="Pagebanner/styles.css"/>
+
{{documentation subpage}}
 +
 
 +
This template places a banner and horizontal Table of Contents at the top of travel guide pages.  This template is a wrapper around the [[mw:Extension:WikidataPageBanner]] extension and should be used instead of invoking the extension directly. For more information about page banner usage on Wikivoyage, see [[Wikivoyage:Banner Expedition]].
 +
 
 +
'''Basic usage:''' <nowiki>{{pagebanner | </nowiki>''image name'' }}
 +
 
 +
* To use the default banner, which inserts the page name and TOC on top of generic image, simply type <nowiki>{{pagebanner}}</nowiki>
 +
*''image name'': Enter the name of the image to use in the banner (excluding "File:"). Images should have a width-to-height ratio of 7:1, preferably 2100 x 300 pixels, and be at least 1800 pixels wide.
 +
 
 +
'''Customizing the banner:''' <nowiki>{{pagebanner | </nowiki>''image name'' | ''caption text'' | ''page name'' | ''disambiguation'' | ''star'' | ''DotM'' | ''OtBP'' | ''Ftt'' | ''TOC box'' }}
 +
 
 +
The template has the following options:
 +
 
 +
*''caption text'': Recommended. Enter ''caption=description'' to display a description of the picture when a mouse pointer is placed over the banner image.
 +
*''page name'': Optional. Enter ''pgname=name'' to display in the banner. Only enter a name if you want it to be different than the formal name of the page. 
 +
*''disambiguation:'' Optional. Displays a disambiguation icon in the banner (a question mark) and the disambiguation hatnote after the banner. Enter ''disambig=yes'' if the name of the disambiguation page is ''page name (disambiguation)''. Enter ''disambig=disambiguation page name'' if the disambiguation page name is different from the current page name.
 +
*''star'': Optional. Enter ''star=yes'' if the guide is a [[Star articles|Star article]]. This displays the Star article symbol in the top right corner.
 +
*''DotM'': Optional. Enter ''dotm=yes'' if the guide is a [[Previous Destinations of the month|previous Destination of the month]]. This displays the DotM symbol in the top right corner and adds [[:Category:Previous Destinations of the month|a category]].
 +
*''OtBP'': Optional. Enter ''otbp=yes'' if the guide has been featured on [[Previously Off the beaten path|Off the beaten path]]. This displays the OtBP symbol in the top right corner and adds [[:Category:Previously Off the beaten path|a category]].
 +
*''Ftt'': Optional. Enter ''ftt=yes'' if the guide has been a [[Previous Featured travel topics|Featured travel topic]]. This displays the Ftt symbol in the top right corner and adds [[:Category:Previous Featured travel topics|a category]].
 +
*''unesco'': Optional. Enter ''unesco=yes'' if the guide is or describes a site on the [[UNESCO World Heritage list]]. Only the lowest level guides in the hierarchy should be tagged (ie, [[Sydney/City Centre]] for the Opera House, not [[Sydney]]). This displays the World Heritage symbol in the top right corner and adds [[:Category:UNESCO World Heritage Sites|a category]].
 +
*''TOC box'': Optional. Enter ''box=black'' for the TOC to appear in a translucent black box with white type. Enter ''box=white'' for the TOC to appear in a translucent white box with black type. Enter nothing for the default solid grey box with black type.
 +
*''notoc'': Optional. Enter ''notoc=true'' to stop the TOC being included in the banner and for the entire TOC to be shown within the article instead. Mainly to be used on articles with lots of sections.
 +
*''index'': Optional. Enter ''index=yes'' for banners on title/index pages or pages in other main namespace article categories which do not always get banners.
 +
*''fop'': Optional. Enter ''fop=yes'' for freedom-of-panorama banners which are not allowed on Commons, to remove them from applicable maintenance categories
 +
* ''origin'': Optional. Use this parameter to define the focal area of the image. This is used to crop the banner appropriately on small screens. The value of the parameter should consist of an x and a y coordinate separated by a comma. Each coordinate represents the distance from the center of the image as a value from -1 to 1. For example, origin=1,1 is the top right corner and origin=-1,1 is the top left corner. There is a graphic [https://phabricator.wikimedia.org/T108785 here] that shows this information visually.
 +
 
 +
<includeonly>
 +
[[Category:Templates]]
 +
</includeonly>
 +
<templatedata>
 +
{
 +
"params": {
 +
"1": {
 +
"label": "Image link",
 +
"suggested": true,
 +
"description": "Banner illustrating the article",
 +
"example": "File:Vue panoramique Parlement de Bretagne.jpg",
 +
"type": "wiki-file-name"
 +
},
 +
"pgname": {
 +
"label": "Page name",
 +
"description": "Enter a name to display in the banner, only if it is different than the formal name of the page.",
 +
"type": "string"
 +
},
 +
"origin": {
 +
"label": "Focal area of the image",
 +
"description": "Use this parameter to define the focal area of the image. This is used to crop the banner appropriately on small screens. The value of the parameter should consist of an x and a y coordinate separated by a comma. Each coordinate represents the distance from the center of the image as a value from -1 to 1. For example, origin=1,1 is the top left corner and origin=-1,1 is the bottom left corner. There is a graphic here that shows this information visually."
 +
},
 +
"unesco": {
 +
"label": "UNESCO World Heritage list element",
 +
"description": " Enter \"yes\" if the guide is or describes a site on the UNESCO World Heritage list. Only the lowest level guides in the hierarchy should be tagged (ie, Sydney/City Centre for the Opera House, not Sydney). This displays the World Heritage symbol in the top right corner and adds a category.",
 +
"type": "boolean"
 +
},
 +
"star": {
 +
"label": "Star article",
 +
"description": " Enter \"yes\" if the guide is a Star article. This displays the Star article symbol in the top right corner.",
 +
"type": "boolean"
 +
},
 +
"otbp": {
 +
"label": "Destination of the month",
 +
"description": " Enter \"yes\" if the guide is has been a  Off the beaten path. This displays the OtBP symbol in the top right corner.",
 +
"type": "boolean"
 +
},
 +
"dotm": {
 +
"label": "Destination of the month",
 +
"description": " Enter \"yes\" if the guide is has been a Destination of the month. This displays the DOtM symbol in the top right corner.",
 +
"type": "boolean"
 +
},
 +
"ftt": {
 +
"label": " Featured travel topic",
 +
"description": " Enter \"yes\" if the guide is has been a Featured travel topic. This displays the FFT symbol in the top right corner.",
 +
"type": "boolean"
 +
},
 +
"notoc": {
 +
"description": "Enter \"true\" to stop the TOC being included in the banner and for the entire TOC to be shown within the article instead. Mainly to be used on articles with lots of sections.",
 +
"label": "No table of contents"
 +
},
 +
"disambig": {
 +
"label": "Disambiguation",
 +
"description": "Enter \"yes\" if the name of the disambiguation page is page name (disambiguation). Enter disambiguation's page name if the disambiguation page name is different from the current page name. It displays a disambiguation icon in the banner (a question mark) and the disambiguation hatnote after the banner. ",
 +
"type": "string"
 +
},
 +
"index": {
 +
"label": "Index pages",
 +
"description": "Enter \"yes\" for banners on title/index pages or pages in other main namespace article categories which do not always get banners."
 +
},
 +
"fop": {
 +
"label": "Freedom of panorama",
 +
"description": "Enter \"yes\" for freedom-of-panorama banners which are not allowed on Commons, to remove them from applicable maintenance categories"
 +
},
 +
"TOC box": {
 +
"label": "TOC box color",
 +
"description": "Enter box=black for the TOC to appear in a translucent black box with white type. Enter box=white for the TOC to appear in a translucent white box with black type. Enter nothing for the default solid grey box with black type."
 +
},
 +
"caption": {
 +
"label": "Caption text",
 +
"description": "Will display a description of the picture when a mouse pointer is placed over the banner image.",
 +
"type": "string",
 +
"suggested": true
 +
}
 +
},
 +
"description": "This template places a banner and horizontal Table of Contents at the top of travel guide pages, with many other information.",
 +
"paramOrder": [
 +
"1",
 +
"caption",
 +
"pgname",
 +
"disambig",
 +
"star",
 +
"otbp",
 +
"dotm",
 +
"ftt",
 +
"unesco",
 +
"TOC box",
 +
"notoc",
 +
"index",
 +
"fop",
 +
"origin"
 +
],
 +
"format": "inline"
 +
}
 +
</templatedata>

Revision as of 13:36, 9 August 2020


This template places a banner and horizontal Table of Contents at the top of travel guide pages. This template is a wrapper around the mw:Extension:WikidataPageBanner extension and should be used instead of invoking the extension directly. For more information about page banner usage on Wikivoyage, see Wikivoyage:Banner Expedition.

Basic usage: {{pagebanner | image name }}

  • To use the default banner, which inserts the page name and TOC on top of generic image, simply type {{pagebanner}}
  • image name: Enter the name of the image to use in the banner (excluding "File:"). Images should have a width-to-height ratio of 7:1, preferably 2100 x 300 pixels, and be at least 1800 pixels wide.

Customizing the banner: {{pagebanner | image name | caption text | page name | disambiguation | star | DotM | OtBP | Ftt | TOC box }}

The template has the following options:

  • caption text: Recommended. Enter caption=description to display a description of the picture when a mouse pointer is placed over the banner image.
  • page name: Optional. Enter pgname=name to display in the banner. Only enter a name if you want it to be different than the formal name of the page.
  • disambiguation: Optional. Displays a disambiguation icon in the banner (a question mark) and the disambiguation hatnote after the banner. Enter disambig=yes if the name of the disambiguation page is page name (disambiguation). Enter disambig=disambiguation page name if the disambiguation page name is different from the current page name.
  • star: Optional. Enter star=yes if the guide is a Star article. This displays the Star article symbol in the top right corner.
  • DotM: Optional. Enter dotm=yes if the guide is a previous Destination of the month. This displays the DotM symbol in the top right corner and adds a category.
  • OtBP: Optional. Enter otbp=yes if the guide has been featured on Off the beaten path. This displays the OtBP symbol in the top right corner and adds a category.
  • Ftt: Optional. Enter ftt=yes if the guide has been a Featured travel topic. This displays the Ftt symbol in the top right corner and adds a category.
  • unesco: Optional. Enter unesco=yes if the guide is or describes a site on the UNESCO World Heritage list. Only the lowest level guides in the hierarchy should be tagged (ie, Sydney/City Centre for the Opera House, not Sydney). This displays the World Heritage symbol in the top right corner and adds a category.
  • TOC box: Optional. Enter box=black for the TOC to appear in a translucent black box with white type. Enter box=white for the TOC to appear in a translucent white box with black type. Enter nothing for the default solid grey box with black type.
  • notoc: Optional. Enter notoc=true to stop the TOC being included in the banner and for the entire TOC to be shown within the article instead. Mainly to be used on articles with lots of sections.
  • index: Optional. Enter index=yes for banners on title/index pages or pages in other main namespace article categories which do not always get banners.
  • fop: Optional. Enter fop=yes for freedom-of-panorama banners which are not allowed on Commons, to remove them from applicable maintenance categories
  • origin: Optional. Use this parameter to define the focal area of the image. This is used to crop the banner appropriately on small screens. The value of the parameter should consist of an x and a y coordinate separated by a comma. Each coordinate represents the distance from the center of the image as a value from -1 to 1. For example, origin=1,1 is the top right corner and origin=-1,1 is the top left corner. There is a graphic here that shows this information visually.


This template places a banner and horizontal Table of Contents at the top of travel guide pages, with many other information.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Image link1

Banner illustrating the article

Example
File:Vue panoramique Parlement de Bretagne.jpg
Filesuggested
Caption textcaption

Will display a description of the picture when a mouse pointer is placed over the banner image.

Stringsuggested
Page namepgname

Enter a name to display in the banner, only if it is different than the formal name of the page.

Stringoptional
Disambiguationdisambig

Enter "yes" if the name of the disambiguation page is page name (disambiguation). Enter disambiguation's page name if the disambiguation page name is different from the current page name. It displays a disambiguation icon in the banner (a question mark) and the disambiguation hatnote after the banner.

Stringoptional
Star articlestar

Enter "yes" if the guide is a Star article. This displays the Star article symbol in the top right corner.

Booleanoptional
Destination of the monthotbp

Enter "yes" if the guide is has been a Off the beaten path. This displays the OtBP symbol in the top right corner.

Booleanoptional
Destination of the monthdotm

Enter "yes" if the guide is has been a Destination of the month. This displays the DOtM symbol in the top right corner.

Booleanoptional
Featured travel topicftt

Enter "yes" if the guide is has been a Featured travel topic. This displays the FFT symbol in the top right corner.

Booleanoptional
UNESCO World Heritage list elementunesco

Enter "yes" if the guide is or describes a site on the UNESCO World Heritage list. Only the lowest level guides in the hierarchy should be tagged (ie, Sydney/City Centre for the Opera House, not Sydney). This displays the World Heritage symbol in the top right corner and adds a category.

Booleanoptional
TOC box colorTOC box

Enter box=black for the TOC to appear in a translucent black box with white type. Enter box=white for the TOC to appear in a translucent white box with black type. Enter nothing for the default solid grey box with black type.

Unknownoptional
No table of contentsnotoc

Enter "true" to stop the TOC being included in the banner and for the entire TOC to be shown within the article instead. Mainly to be used on articles with lots of sections.

Unknownoptional
Index pagesindex

Enter "yes" for banners on title/index pages or pages in other main namespace article categories which do not always get banners.

Unknownoptional
Freedom of panoramafop

Enter "yes" for freedom-of-panorama banners which are not allowed on Commons, to remove them from applicable maintenance categories

Unknownoptional
Focal area of the imageorigin

Use this parameter to define the focal area of the image. This is used to crop the banner appropriately on small screens. The value of the parameter should consist of an x and a y coordinate separated by a comma. Each coordinate represents the distance from the center of the image as a value from -1 to 1. For example, origin=1,1 is the top left corner and origin=-1,1 is the bottom left corner. There is a graphic here that shows this information visually.

Unknownoptional