Help:Customizing toolbars

The left sidebar and the top personal toolbar can be customized by editing skin.js or common.js. applies to only the current skin, where  applies to all skins.

Overview
General usage:

Where:
 * : the ResourceLoader function to add links to the portlets.
 * : portlet id— the section where the new menu item is to be placed. Valid values:
 * : Navigation section in left sidebar
 * : Interaction section in left sidebar
 * : Toolbox section in left sidebar
 * : Print/export section in left sidebar
 * : Languages section in left sidebar
 * : In other projects section in left sidebar
 * Personal toolbar at the top of the page
 * Upper right tabs in Vector only (read, edit, history, watch, etc.)
 * Drop-down menu containing move, etc. (in Vector); subject/talk links and action links in other skins
 * : Link to the Wikipedia or external page
 * : Text that displays
 * : HTML id (optional)
 * : Tooltip to display on mouseover (optional)
 * : Shortcut key press (optional)
 * : Existing portlet link to place the new portlet link before (optional)

The optional fields must be included in the above order. To skip a field without changing it, use the value null.

Href
Links to Wikipedia pages are of the form '/wiki/ page name '; example: '/wiki/Special:NewPages'.

External links are formatted using the full URL; example: 'http: //example.org'.

There are a number of configuration variables that can be used to create more complex links. A configuration variable is read using the function :


 * : Local path, starting at the root, to reference articles, containing a "$1" placeholder that may be replaced by a page title to get a valid URL to that page.
 * : The full name of the page, including the localized namespace name, if the namespace has a name (the main namespace (number 0) doesn't), and with blanks replaced by underscores.
 * : The server URL, not terminated by "/".

Given a valid page title title, a valid URL may be constructed using mw.config.get('wgArticlePath').replace('$1', title)

However, for local links it may be more advisable, and simple, to use the method  (description, API documentation):

Examples
Add portlet to a user subpage on the left toolbar:

Add portlet to Special:NewPages on the left toolbar:

Open the current page in Checklinks on the left toolbar:

Open the current page in Reflinks on the left toolbar:

Open page in Reflinks, on the personal toolbar; formatted in multiple lines:

Add a portlet to open user subpages to the personal toolbar, placed before the Preferences portlet: