MediaWiki:Sitenotice: Difference between revisions

From GDPRhub
(Add explanation for how to put a random banner above every page)
 
No edit summary
 
(64 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<!--
EXPLANATION
This “Sitenotice” is a bar shown above the page content (across the whole wiki). We use it for showing a banner image.
Technical details:
- The javascript defined in MediaWiki:Common.js will show one of the html elements marked with the class “random-banner-option”, removing everything else in the "random-banner-container".
- The style rules defined in MediaWiki:Common.css will hide all content of this element before this script has run.
Usage/Tips:
- Upload your images, then copy & adapt example an item below.
- Ideally use an image that is 100px high; larger ones are scaled down to be at most 100px high.
- Screens can have many widths! A very wide banner will be scaled down on a narrow screen.
- When there should be no banner, remove (or comment out) the whole code, to avoid an empty space.
- Better not list dozens of images here, as *all* image options will be downloaded by the browser (not only the one that is picked).
- The code is just wikitext; so be aware that whitespace can matter (e.g. don’t start a line with spaces)
EXAMPLE CODE:
<div class="random-banner-container">
<div class="random-banner-container">
 
<div class="random-banner-option"></div>
<div class="random-banner-option" style="background-color: silver;">
<div class="random-banner-option"></div>
[[File:3yrsgdpr.jpg|link=https://noyb.eu/en/statement-3rd-anniversary-gdpr]]
</div>
</div>
 
<!-- <div style="font-size: smaller; float:right;">[[GDPRhub_Sponsorship|Sponsoring options on GDPRhub]]</div> -->
<div class="random-banner-option" style="background-color: black;">
[[File:Pug flags.png|link=https://noyb.eu/en/luxemburgs-watchdog-refuses-show-its-teeth-us-companies]]
</div>
 
</div>
 
ACTUAL CODE BELOW
-->

Latest revision as of 15:26, 29 January 2024