Last modified: 2011-03-13 18:04:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 4042 - Namespace specific GUI Changes
Namespace specific GUI Changes
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
All All
: Lowest enhancement with 7 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
: 2291 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2005-11-20 23:52 UTC by Nick Kossifidis
Modified: 2011-03-13 18:04 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Patch for Skin.php (1.72 KB, patch)
2005-11-20 23:55 UTC, Nick Kossifidis
patch for r16100 adding namespace-specific interfaces (1.8-svn) (2.59 KB, patch)
2006-08-17 05:26 UTC, Dan Li

Description Nick Kossifidis 2005-11-20 23:52:58 UTC
I thought it would be usefull if someone could use different logos and sidebars
in different namespaces (e.g. different logo for the Help namespace and a
sidebar with the help categories) but i couldn't find a way to do it. So i
created a patch that does the folowing:

You can change the logo on a namespace using the $wgNamespaceLogos array.

$wgNamespaceLogos = array(<namespace_number> => <url_path_to/logo.gif>)

You can attach a custom sidebar to a namespace by creating a message
"nsbar_<namespace_number>" in the MediaWiKi namespace (that has the same format
as the "sidebar" message).

Hope you find it useful :-)

Comment 1 Nick Kossifidis 2005-11-20 23:55:34 UTC
Created attachment 1087 [details]
Patch for Skin.php

To apply the patch, save the patch to a file e.g. nsattrs.patch, go to the
mediawiki directory and run:

patch -p0 < nsattrs.patch
Comment 2 Nick Kossifidis 2005-11-21 16:47:37 UTC
Note: The above patch is for version 1.5.2
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-08-10 22:53:46 UTC
*** Bug 2291 has been marked as a duplicate of this bug. ***
Comment 4 Dan Li 2006-08-17 05:26:13 UTC
Created attachment 2238 [details]
patch for r16100 adding namespace-specific interfaces (1.8-svn)

This patch does pretty much the same thing as the 1.5.2 patch, for 1.8.

Logos (same):
- $wgNamespaceLogos -- array: NS_* => [logo url]

Sidebar (different):
- sidebar[NS_*] (instead of nsbar_[NS_*]) -- sidebar sounds better than nsbar,
- sidebar[NS_*] replaces sidebar, instead of augmenting it, but falls back to
sidebar if it doesn't exist
Comment 5 Chad H. 2009-12-21 14:19:43 UTC
Going to close this as WONTFIX, because I don't think this is something we need in core.

However, there are a few good workarounds to do what you want. Since we include the namespace as a class on <body> (in addition to in the Javascript globals we provide), it's very easy to write custom CSS and use Javascript to manipulate the page on a per-namespace basis. Same goes for the sidebar: you can write a function to hook into SkinBuildSidebar to customize the sidebar; this does break the sidebar cache, though.
Comment 6 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-12-21 14:24:45 UTC
Note that for instance, you can do a per-namespace logo with CSS like this:

body.ns-1 #p-logo a { background-image: url(my_talk_logo_url.png) !important; }

That will use the given image for the logo in ns1 (i.e., Talk:).  The logo is only added in the first place using CSS anyway.  So a whole new config option just for this is overboard.

Note You need to log in before you can comment on or make changes to this bug.