Extension:WikidataPageBanner

The WikidataPageBanner extension adds pagewide banners on every page of specified namespaces of the wiki. Pagewide banners are extensively used on Wikivoyage projects and this extension is inspired majorly from pagebanner

Usage
The extension automatically adds a banner image on pages of specified namespaces. To use a custom banner image, use   with a set of parameters explained below. If the wiki is connected to wikidata, it can also fetch banners from there

Parameters to the function
The following parameters are supported to the   parser function:
 * pgname - Adds a custom title to the banner.
 * To add custom icons, add the parameter icons=icon1,icon2,... to  . Then define a background-image on .oo-ui-icon-icon1, .oo-ui-icon-icon2, in Mediawiki:Common.css to use as the icon.
 * caption - Use caption=description to add a caption to the banner image.
 * tooltip - Use tooltip=image-caption to show image description on hovering over image.

Required Settings
$wgPBImage is used to set the default banner image to be used. Add image name without prefixing 'File:' namespace. Note that if the wiki does not need default banners, do not edit this field. $wgBannerProperty (Essential if Wikidata is enabled) - Banner property on wikidata which holds commons media file

Optional Settings
$wgBannerNamespaces array of namespaces on which to dispaly the banner. Default is Main namespace $wgStandardSizes is an array of standard predefined screen widths in increasing order of size

Examples
A few use examples with explanation: Will add a banner using image Grand_canyon.jpg as source locally or from wikimedia commons. Will add a banner using image Grand_canyon.jpg as source locally or from wikimedia commons. Additionally will add icons with class names oo-ui-icon-star, oo-ui-icon-unesco. Set background-image property on theses classes in Mediawiki:Common.css to your desired icon. Will add a banner using image Grand_canyon.jpg as source locally or from wikimedia commons. Additionally adds a toc inside banner. Sets the name displayed on banner as Some page. Will add a banner trying to fetch banner image from wikidata property specified above if exists. If it does not exist, tries to add a default banner. Sets the name displayed on banner as Some page.

Styling
The extension has ample scope of styling the banner from Mediawiki:Common.css For example, putting the codes given below in Mediawiki:Common.css would result as explained below: This would set the toc to appear just below the banner in case its long Would set the font size of Banner Name as 1em.