Template:CustomHeader: Difference between revisions
Fabrice P. Laussy's Web
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{#if:{{{headertext|}}}|== {{{headertext|Default Header}}} ==<div style="display:none;" id="custom-header-text"></div>|== Default Header ==<div style="display:none;" id="custom-header-text"></div>}}
{{#if:{{{headertext|}}}|== {{{headertext|Default Header}}} ==|== Default Header ==}}
<div class="custom-header-anchor" style="display:none;" id="custom-header-text"></div>
<div class="custom-header"  
<div class="custom-header"  
     data-image="{{{image|}}}"  
     data-image="{{{image|}}}"  
Line 15: Line 16:
<noinclude>
<noinclude>
This template overrides the default header image and text, wrapping headertext in an <h1> tag with custom styling and ensuring TOC inclusion.
This template overrides the default header image and text, wrapping headertext in an <h1> tag with custom styling and ensuring TOC inclusion.
Usage: {{CustomHeader
 
== Usage ==
{{CustomHeader
   |image=http://localhost/laussywiki/images/1/1d/Roof-of-Faro.jpg
   |image=http://localhost/laussywiki/images/1/1d/Roof-of-Faro.jpg
   |headertext=Trip to Algarve (May 2017)
   |headertext=Trip to Algarve (May 2017)
Line 26: Line 29:
   |blurbposition=bottom:20px;right:20px;font-size:large;width:70%;text-align:right
   |blurbposition=bottom:20px;right:20px;font-size:large;width:70%;text-align:right
}}
}}
Note: Use the full image URL from the File: namespace. Use headerposition and blurbposition as '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'. The headertext is included in the TOC and styled as an <h1>. Add CSS to MediaWiki:Common.css to hide the default TOC heading: h1#section_0 { display: none; }
 
== Notes ==
* Use the full image URL from the File: namespace.
* Use headerposition and blurbposition as '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'.
* The headertext is included in the TOC and styled as an <h1>.
* Add the following CSS to MediaWiki:Common.css to hide the default TOC heading:
```css
h1#section_0 { display: none; }
```
 
</noinclude>
</noinclude>

Revision as of 23:31, 29 June 2025

Default Header

Default Header

This template overrides the default header image and text, wrapping headertext in an

tag with custom styling and ensuring TOC inclusion.

Usage

Trip to Algarve (May 2017)

Trip to Algarve (May 2017)

The Algarve, from Arabic الغرب‎‎ al-Gharb, «the West», that is, the west of Al-Andalus, is a mythical part of Europe...


Notes

  • Use the full image URL from the File: namespace.
  • Use headerposition and blurbposition as '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'.
  • The headertext is included in the TOC and styled as an

    .

  • Add the following CSS to MediaWiki:Common.css to hide the default TOC heading:

```css h1#section_0 { display: none; } ```