Last modified: 2014-06-23 16:07:00 UTC
I'd like to display a Sitenotice for logged-in users and have no notice displayed for anonymous users. There should be a way to disable the Anonnotice from inheriting the Sitenotice when it's not in use.
http://en.wikipedia.org/wiki/MediaWiki_talk:Sitenotice says: The "Sitenotice", found at MediaWiki:Sitenotice, is displayed at the top of all pages for all logged-in users, and for anonymous users if MediaWiki:Anonnotice is empty; this latter message can be used to display information only to readers, not editors. Alternatively, by 'blanking' the anonnotice and replacing it with <p></p>, the sitenotice can be used as a "logged-in-notice" to display information only to editors. I assume that fits your needs?
Nope, because a larger space is created than if there was no notice. One of my Site Notices has a background, and a sliver of that shows if you use this method. When the notice is disabled, none of it should show. For the rest, it's just a larger white space. That's a hack and not an ideal solution to the problem. Which is why this bug exists.
Hmm. Even when using something like <span></span> or such, instead of a whole paragraph like <p></p>? Anyway, I'd say that this might be good question for https://www.mediawiki.org/wiki/Project:Support_desk too.
Yes, because as long as the Anon Notice is not in its disabled state, extra HTML is added to the web page. Just using <span></span> adds this code: <div id="siteNotice"><div lang="en" dir="ltr" id="localNotice"> <p><span></span></p> </div></div> Ideally, the Anon Notice should actually be disabled and none of that would show up. I could hide the DIV with CSS, but remember that logged-in users *do* need to see it.