Help:CentralNotice

From The Scuba Wiki

Jump to: navigation, search
MediaWiki Handbook: Contents, Readers, Editors, Moderators, System admins +/-
Comment Before editing the CentralNotice, you should be very familiar with the content on this page. Changes to Special:CentralNotice affect all Wikimedia wikis, and should be done with extreme care and only if you know what you're doing.

The CentralNotice is the software mechanism that distributes global messages throughout Wikimedia. These messages are widely translated and typically relate to matters that concern the community at large, such as the 2009 shift to the CC-BY-SA 3.0 license, the annual Wikimania events, and the 2009 Strategy planning initiative.

The CentralNotice admin is a tool used for the creation of CentralNotices. How the CentralNotice admin works and how to use it are the primary concerns of this page.

Contents

Using the CentralNotice

Notices

The CentralNotice admin is located at Special:CentralNotice and can only be used by Meta administrators. On this page, one is immediately presented with a list of notices currently in use. Each notice broadcasts a particular message across Wikimedia.

The CentralNotice main page

Each item above links to a page containing details about a given notice: its start date, start time, and end time; and the project name, which specifies which of the projects a given notice is particular to (if any). The checkboxes immediately below customise the relative priority and enablement of the notice. Notices which are preferred are given precedence over other notices in situations when a number of global notices are on a rotation. If we wish to get rid of the notice altogether, we can select "Remove". When we are done, we click "submit" at the very bottom of the page.

The notice below is enabled, but not preferred or locked.

This notice is enabled, but not preferred or locked.

To create a new notice, scroll to the bottom of the page and fill in the following toolbox. The checkbox options are filled-in and altered later.

Add a notice

Templates

Each notice is assigned templates. Templates actually carry the message text, whereas the notices are topical categories for the templates. For example, during the 2008–2009 fundraiser, the "fundraiser_all_projects" notice was assigned a variety of "please donate" and "personal appeal from Jimmy Wales" templates, each containing a unique message:

2008_scales
2008_scales
2008_jimmy_letter
2008_jimmy_letter

Right now, because the fundraiser has ended, fundraiser_all_projects is assigned only the post-fundraiser "thank you" note from Jimmy Wales:

2008_jimmy_thank_you_b
2008_jimmy_thank_you_b

If we click on a template link, we are led on to another page from which we can edit the template and insert translations of the message text. In 2008_jimmy_thank_you_b, we see the following directly below the Preview:

Messages and languages of 2008_jimmy_thank_you_b

"letter-url" and "personal-appeal" link to the MediaWiki-space pages at which the message text is contained: MediaWiki:Centralnotice-2008 jimmy thank you b-letter-url and MediaWiki:Centralnotice-2008 jimmy thank you b-personal-appeal are respectively the English translations. Altering the text here will automatically edit the relevant MediaWiki pages. We are able to insert new translations for the message text by selecting a language in the drop-down box below "Change translation language". The MediaWiki page for a message mmm in a template ttt in a non-English language qqq is at MediaWiki:Centralnotice-ttt-mmm/qqq. For example, the MediaWiki page for the Russian (ru) translation of the "personal-appeal" component of "2008 jimmy thank you b" is at MediaWiki:Centralnotice-2008 jimmy thank you b-personal-appeal/ru.

Further down, we see the raw code for 2008_jimmy_thank_you_b – its look, colour, size, and formatting, and where the message snippets ("letter-url" and "personal-appeal") are located. It is unadvisable to edit the text in this box without purpose and without having a good knowledge of CSS.

The raw code for 2008_jimmy_thank_you_b

If we wish to assign more templates to "fundraiser_all_projects" notice, we can return to the notice's main page, tick "Add" for the templates we want under "Available templates", and click submit at the bottom of the page.

Available templates
Bottom of page
Submit

If we wish to create an entirely new template, we go to the top of Special:CentralNotice, click "templates", scroll to the bottom, and click "Add a template":

Notices selected: Special:CentralNotice
"Notices" selected
Templates selected: Special:NoticeTemplate
"Templates" selected
Bottom of Special:NoticeTemplate
Add a template

From Special:NoticeTemplate, we are also able to view, click on, and remove all templates currently available.

Design

Central Notice templates are composed of four different pieces.

  1. CSS
  2. JS
  3. HTML
  4. MW Messages

CSS

When setting up any new notice it is vital that whatever CSS is used has to be isolated to just that notice. For instance 2009_Notice1_b is an excellent example of good isolation. All of its css is prefaced with specific identifiers like .notice-all for cross notice settings, .notice for notice specific settings and .siteNotice for internal system settings.

A bad example of used css are additions like .a and .p which would affect all text within the body of the page.

JS

Some notices feature a custom set of JS for added functionality. 2009_Notice30 is an example of one that has an added goToDonationPage function which allows the destinaton url to be further randomized without the need for multiple notices.

If you find yourself adding the same JS to multiple notices then it is likely that it should just be added to main centralnotice.js file.

Collapse/Expand

Since collapsing and expanding is core to every notice the js code for it is located right within the extension. Simply making a call to toggleNotice() will give you the desired functionality.

HTML

When creating the actual structure of the notice, pay particular to keeping the design as simple as possible. Design them as if it was 1998 and use the lowest amount of complexity possible. 2009_Notice31 is a good example of very simple layout. All items are controlled through their own divs to allow for maximum customization while keeping the html simple.

MW Messages

We utilize triple bracket mediawiki messages in order to allow for translations. In order to add a new message you simply add:

{{{varname}}}

and after the form submission you will see the new message show up in the template translation window. To add a new language translations change the language option under Language to the desired setting and add the new translation.

Shared Message Namespace

A convenient reuse available in the system is the ability to re-use messages from other templates. This allows us to not have to re-input the exact same message set that a collection of notice might use. A current example of this includes 2009_Notice30 which has messages like

 {{int:Centralnotice-2009_Notice1-donate-text2}}

What this means is that we are pulling the donate-text2 variable from the 2009_Notice1 templates and re-using its content. This is very helpful when you have multiple notices all needing to point to one url. By keeping it set on one template you only have to change it in one place.

Creating a new notice

If one is lucky then the template you are trying to add already has a close approximate in the system. Copy the existing body into a new template by following the link at the bottom of the Templates tab labeled 'Add a new template' . Add the appropriate new messaging and load the inline preview to validate that all is well.

Large Template / Anonymous / Logged in

The current banner system support three parts to any one template. All are required to be used. These includes

  1. siteNoticeBig - Main large notice
  2. siteNoticeSmallAnon - Collapsed notice that non logged in users will see
  3. siteNoticeSmallUser - Collapsed notice that logged in users will see

Within the html block of your template you will be using each of these three identifiers to start a separate div.

For instance:

 <div class="notice-all siteNoticeBig" align="center">
 <a class="notice-pitch" href="javascript:goToDonationPage()">
  <div class="notice-pitch-text">
 ...

This block defines a new large notice and goes on to specify its format. After this div is complete we add a section for the next part.

 <div class="notice-all siteNoticeSmallAnon">
 <div class="notice-toggle">[<a href="#" onclick="toggleNotice()"><span>{{int:centralnotice-shared-show}}</span></a>]</div>
 <a class="notice-slogan" href="javascript:goToDonationPage('collapsed')">
 ...

This block defines a new anonymous collapsed notice and goes on to specify its format. Finally we add the last section

 <div class="notice-all siteNoticeSmallUser">
 <div class="notice-toggle">[<a href="#" onclick="toggleNotice()"><span>{{int:centralnotice-shared-show}}</span></a>]</div>
 <a class="notice-slogan" href="{{{donate-url}}}utm_source=2009_Notice1_collapsed&utm_medium=sitenotice&utm_campaign=fundraiser2009">

Which defines a new use collapsed notice and goes on to specify its format.

Each template is first shown to the user as a siteNoticeBig and has siteNoticeSmallAnon & siteNoticeSmallAnon disabled with the css identifier

{display:none;}

Once a user click on collapse the big notice has display set to none and has the corresponding collapsed notice set to

{display:block;}

Deployment

Once a template is configured in the Central Notice system it is up to the user to make sure it look correct across all of our supported browsers. There are currently four steps to verifying any one banner.

  1. After saving your html/css/js use the inline preview to verify that the content is as it should be. Having multiple browsers to test with is extremely important as we have a diverse set of users who use both ie6+, firefox2+ and many others.
  2. If the inline preview looks ok then select the option labeled Preview all available translations of template . If you have any translations other then English you should see them now. Pay close attention to spacing and text that is too long and either adjust the messaging or html/css to accommodate it as best as possible.
  3. Add the template to the rotation on test wiki by taking your creation and adding it to the test notice
    1. Within five minutes you should be able to see your new notice on test wiki. Just as before, test with a full suite of browsers to see how the notice does with actual page content. Make sure that no styling within the body of the message overrides the styling of the page text.
  4. If all has gone well your likely ready to push it into production. Please clear any messaging that is to go out with their respective communities before enabling anything. Having gotten the correct approval add your template to the correct notice and load it on the project in question. While it may seem like you have already validated your notice both in preview and on test there are still css quirks that show up in each project. These have to be dealt with on a case by case basis.

Do not rely on the NoticeTemplate view to be an accurate representation of the template. The only way to see a correct preview is to click the template and see the inline preview on its detail page.

See also

  • CentralNotice – A translation landing page for current CentralNotices.


Links to other help pages

Help contents
Meta | Wikinews | Wikipedia | Wikiquote | Wiktionary | commons: | mw: | b: | s: | mw:Manual | google
Versions of this help page (for other languages see below)
Meta | Wikinews | Wikipediahttp://en.wikipedia.org/Help:CentralNotice | Wikiquote | Wiktionary
What links here on Meta or from Meta | Wikipedia | MediaWiki
Reading
Go | Search | Stop words | URL | Namespace | Page name | Section
Backlinks | Link | Piped link | Interwiki link | Redirect | Category | Image page
Logging in and preferences
Logging in | Preferences | User style
Editing
Advanced editing | Editing FAQ | Edit toolbar | Export | Import | Shortcuts
Tracking changes
Recent changes (enhanced) | Related changes | Watching pages | Diff
Page history | Edit summary | User contributions | Minor edit | Patrolled edit
Style & formatting
Wikitext examples | Reference card | HTML in wikitext | List | Table | Sorting | Colors
Special input and output
Inputbox | Special characters | Displaying a formula | Images (uploads) | EasyTimeline
Advanced functioning
Template | Advanced templates | Parser function | ParserFunctions | Parameter default
Variable | Magic word | System message | Substitution | Array | Calculation
Page management
Starting a new page | Renaming (moving) a page | Protecting pages | Deleting a page
Special pages
Talk page | Testing | Sandbox | CentralNotice

Template:-

Personal tools
support the site