GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing www.mediawiki.org — Snippets/Main Page tab - MediaWiki < Snippets
DescriptionOn the main page (and its associated namespaces and actions (Talk, edit, history etc.) this script will put "Main Page" instead of "Article" or "Page" in the first tab. Works in both Vector and Monobook. Native
If you are using 1.18 or higher, you can instead use the interface message "mainpage-nstab". You can do this by creating the page Code
/** * MainPage tab * * @source mediawiki.org/wiki/Snippets/Main_Page_tab * @version 2014-07-30 */ $( function() { var title = mw.config.get( 'wgTitle' ), hasMainPageTab = (title === 'Main Page'); // Title of the main page if ( hasMainPageTab ) { $( '#ca-nstab-main' ).find( 'a' ).text( title ); } } ); AlternativePageTab.js /** * Page-tab * Replace "Article", "Page", or whatever in page/namespace tab with custom string * * @rev 1 */ $( document ).ready( function () { var title = $.trim( $( '#mw-nstab' ).data( 'nstab' ) ); if ( title !== '' ) { $('#ca-nstab-' + ( mw.config.get( 'wgCanonicalNamespace' ).toLowerCase() || 'main' ) ).find( 'a' ).text( title ); } } ); Template:Page_tab <span id="mw-nstab" data-nstab="{{{1|}}}"></span>
Usage {{Page tab|Awesome Tab}}
| ||||||||||
| You are visitor 01402605 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||