Forum:Uncyclopedia logo

How do they get different Image:Wiki.pngs for different parts of the Wiki? GangstaEB Get up with me! 03:20, 25 June 2006 (UTC)


 * There are two methods in use, currently. To change the logo for a namespace, you edit your default site-wide skin (Uncyclopedia:MediaWiki:Uncyclopedia.css for Uncyclopedia, but MediaWiki:Monobook.css for most other wikia). For example, these two lines change the logo on the Image: and Image_talk: namespaces.

body.ns-6 #p-logo a { background-image: url(/images/d/d5/Uncyclomedia_Commons.png) !important; } body.ns-7 #p-logo a { background-image: url(/images/d/d5/Uncyclomedia_Commons.png) !important; }
 * However, this only works for full namespaces.


 * The other method, to change it on a per-page basis, is to use javascript. The site-wide js for Uncyclopedia is: Uncyclopedia:MediaWiki:Uncyclopedia.js but note that on other wikia it is usually MediaWiki:Monobook.js. The simplest example is something like:

if(document.title.indexOf("Main Page - ") == 0) { document.write('/*<!>*/ '); }


 * Which triggers if the title of the page is "Main Page". But that makes it hard to tweak the code or do multiple style changes (like background colors) (However, it can be utilized to show a random logo on each page load where the other methods cannot).


 * A slightly more advanced method is to point to a full style sheet:

if(document.title.indexOf("Main Page - ") == 0) { document.write('/*<![CDATA[*/ @import "/index.php?title=MediaWiki:Skin/Something.css&action=raw&ctype=text/css&smaxage=18000"; /*]]>*/ '); }


 * You then need to create MediaWiki:Skin/Something.css (or whever you point to it. Note: it should be protected, MediaWiki: namespace is protected automatically, but User namespace is semiprotected for pages ending in .css or .js, example: User:Splarka/Something.css) with contents like:


 * 1) p-logo a { background-image: url(/images/d/d5/Uncyclomedia_Commons.png) !important; }


 * Which will change the logo. Note:you can have this process semi-automated. A script written on Uncyclopedia and now used on the central Wikia here can be utilized to automatically point to a .css in MediaWiki namespace. See MediaWiki:Monobook.js.


 * You can find some examples (ranging from logo changes to full restyles) at: . NOTE however that it is against Wikia policy to block the google ads via this method on any page. --Splarka (talk) 04:19, 25 June 2006 (UTC)


 * Question. For the changing of the logo for a namespace, how are you able to determine which number to use. For example, it says above :

body.ns-6 #p-logo a { background-image: url(/images/d/d5/Uncyclomedia_Commons.png) !important; } body.ns-7 #p-logo a { background-image: url(/images/d/d5/Uncyclomedia_Commons.png) !important; }


 * My question is why is it body.ns-6 and body.ns-7? How are you able to determine which namespace this is and how can you select only the specific namespace you want to have the namespace changed. -- Meghunter99 Talk to me! 17:04, September 1, 2009 (UTC)

http://www.wikia.com/api.php?action=query&meta=siteinfo&siprop=namespaces --Uberfuzzy 17:19, September 1, 2009 (UTC)

also, http://www.wikia.com/wiki/Help:Namespace#What_namespaces_do_all_wikis_have.3F


 * What about custom added namespaces that aren't listed there. Is there a way to find out the number of that kind of particular namespace. For reference, I'm referring to this namespace. Thanks! -- Meghunter99 Talk to me! 17:45, September 1, 2009 (UTC)