mNo edit summary |
mNo edit summary |
||
| Line 4: | Line 4: | ||
<h1 style="margin:0;padding:0;font-size:inherit;color:inherit;background-color:transparent;">{{{maintitle|{{PAGENAME}}}}}</h1> | <h1 style="margin:0;padding:0;font-size:inherit;color:inherit;background-color:transparent;">{{{maintitle|{{PAGENAME}}}}}</h1> | ||
</div> | </div> | ||
<div class="custom-header" | <div class="custom-header" | ||
data-image="{{{image|}}}" | data-image="{{{image|}}}" | ||
| Line 15: | Line 14: | ||
data-blurbcolorbackground="{{{blurbcolorbackground|rgba(207, 211, 222, 0.66)}}}" | data-blurbcolorbackground="{{{blurbcolorbackground|rgba(207, 211, 222, 0.66)}}}" | ||
data-blurbposition="{{{blurbposition|top:10px;left:20px}}}"> | data-blurbposition="{{{blurbposition|top:10px;left:20px}}}"> | ||
< | <span style="color:{{{headercolor|blue}}};background-color:{{{headercolorbackground|rgba(207, 211, 222, 0.66)}}};{{{headerposition|top:5px;left:10px;font-size:24px;width:300px;text-align:left}};display:inline-block;">{{{headertext}}}</span> | ||
<div style="color:{{{blurbcolor|black}}};background-color:{{{blurbcolorbackground|rgba(207, 211, 222, 0.66)}}};{{{blurbposition|top:10px;left:20px}}}">{{{blurb|}}}</div> | <div style="color:{{{blurbcolor|black}}};background-color:{{{blurbcolorbackground|rgba(207, 211, 222, 0.66)}}};{{{blurbposition|top:10px;left:20px}}}">{{{blurb|}}}</div> | ||
</div> | </div> | ||
<noinclude> | <noinclude> | ||
This template creates a custom page title (<h1>) | This template creates a custom page title (<h1>) included in the TOC as toclevel-1, a styled header (not in TOC), and an optional blurb. Subsequent ==content== headers appear as <h2> at toclevel-2 in the TOC. | ||
== Usage == | == Usage == | ||
| Line 28: | Line 27: | ||
|image=http://localhost/laussywiki/images/1/1d/Roof-of-Faro.jpg | |image=http://localhost/laussywiki/images/1/1d/Roof-of-Faro.jpg | ||
|headertext=Trapped in the Province of Jaén (December 2017-January 2018) | |headertext=Trapped in the Province of Jaén (December 2017-January 2018) | ||
|headercolor=white | |headercolor=white | ||
|headercolorbackground=rgba(54, 25, 25, 0.5) | |headercolorbackground=rgba(54, 25, 25, 0.5) | ||
| Line 39: | Line 37: | ||
== Notes == | == Notes == | ||
* The `maintitle` parameter sets the page title. If omitted, it defaults to `{{PAGENAME}}`. | * The `maintitle` parameter sets the page title, included in the TOC as <h1> (toclevel-1). If omitted, it defaults to `{{PAGENAME}}`. | ||
* The ` | * The `headertext` is displayed but not included in the TOC. | ||
* Use the full image URL from the File: namespace. | * Use the full image URL from the File: namespace. | ||
* Use `headerposition` and `blurbposition` in the format 'top:XXpx;left:YYpx;font-size:VALUE;width:VALUE;text-align:VALUE' or 'bottom:XXpx;right:YYpx;font-size:VALUE;width:VALUE;text-align:VALUE'. | * Use `headerposition` and `blurbposition` in the format 'top:XXpx;left:YYpx;font-size:VALUE;width:VALUE;text-align:VALUE' or 'bottom:XXpx;right:YYpx;font-size:VALUE;width:VALUE;text-align:VALUE'. | ||
* | * Subsequent ==content== headers are <h2> (toclevel-2) in the TOC. | ||
* The `__TOC__` directive forces the TOC to appear. | * The `__TOC__` directive forces the TOC to appear. | ||
* Add the following CSS to `MediaWiki:Common.css` to hide the default MediaWiki page title and ensure proper styling: | * Add the following CSS to `MediaWiki:Common.css` to hide the default MediaWiki page title and ensure proper styling: | ||
| Line 49: | Line 47: | ||
```css | ```css | ||
/* Hide the default MediaWiki page title */ | /* Hide the default MediaWiki page title */ | ||
#firstHeading, .mw-first-heading { | #firstHeading, .mw-first-heading, .mw-page-title { | ||
display: none !important; | display: none !important; | ||
visibility: hidden !important; | |||
height: 0 !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
} | } | ||
/* Ensure custom headers are styled correctly */ | /* Ensure custom headers are styled correctly */ | ||
.custom-header-maintitle h1 | .custom-header-maintitle h1 { | ||
margin: 0; | margin: 0; | ||
padding: 0; | padding: 0; | ||
| Line 60: | Line 62: | ||
color: inherit; | color: inherit; | ||
background-color: transparent; | background-color: transparent; | ||
} | |||
.custom-header span { | |||
display: inline-block; | |||
} | } | ||
{{{headertext}}}
This template creates a custom page title (
Trapped in the Province of Jaén (December 2017-January 2018)
```css /* Hide the default MediaWiki page title */
display: none !important; visibility: hidden !important; height: 0 !important; margin: 0 !important; padding: 0 !important;
}
/* Ensure custom headers are styled correctly */ .custom-header-maintitle h1 {
margin: 0; padding: 0; font-size: inherit; color: inherit; background-color: transparent;
} .custom-header span {
display: inline-block;
}