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)