[Mediawiki-l] Remove Main Page header from the main page

Marco Rota marcor at sorint.it
Fri May 26 10:12:28 UTC 2006


I've added the code but it seem nothing is happend...

Sorry... I'm not a programmer.


----- Original Message ----- 
From: "Rotem Liss" <mail at rotemliss.com>
To: "MediaWiki announcements and site admin list" 
<mediawiki-l at Wikimedia.org>
Sent: Friday, May 26, 2006 11:43 AM
Subject: Re: [Mediawiki-l] Remove Main Page header from the main page


>I use the following code in MediaWiki:Monobook.js:
>
> /* Hide the main page title */
> function hideMainPageTitle(e)
> {
>    e = (e) ? e : event;
>    var mainPageTitle = "Main Page";
>    var headings = document.getElementsByTagName("h1");
>    var i, done = false;
>    for (i = 1; ((!done) && (i <= headings.length)); i++)
>    {
>        if (headings[i - 1].className == "firstHeading")
>        {
>            done = true;
>            if ((headings[i - 1].innerHTML == mainPageTitle) && 
> (document.getElementById("contentSub").innerHTML == ""))
>            {
>                headings[i - 1].style.display = "none";
>                document.getElementById("siteSub").style.display = "none";
>                document.getElementById("contentSub").style.display = 
> "none";
>            }
>        }
>    }
> }
> window.onload = hideMainPageTitle;
>
> It works just fine. However, if you use window.onload also for other
> functions, you should use instead window.addEventListener for the
> standard browsers, and window.attachEvent for the evil browser Internet
> Explorer. You can check the user agent or "document.all" (true in IE,
> false in the other browsers), and you can read about these functions in
> the W3C standard/Mozilla documentation (addEventListener), and in the
> MSDN (attachEvent).
>
> Also, I haven't checked it, but I think using the following function:
>
> addOnloadHook(hideMainPageTitle);
>
> will also work.
>
>
> Brion Vibber wrote:
>
>>Kent Sandvik wrote:
>>
>>
>>>I tried to google and read the MediaWiki FAQ, but I could not find the
>>>answer. What's the trick to remove the <h1 class="firstHeading">Main
>>>Page</h1> and the lines from the main page, so there's no block above
>>>the contents, similar to the top page in wikipedia?
>>>
>>>
>>
>>It's some sort of JavaScript hack in MediaWiki:Monobook.js.
>>
>>-- brion vibber (brion @ pobox.com)
>>
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>MediaWiki-l mailing list
>>MediaWiki-l at Wikimedia.org
>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>>
>
> -- 
> #define Name RotemLiss
> #define Mail mailSTRUDELrotemlissDOTcom
> #define Site www.rotemliss.com
>
>


--------------------------------------------------------------------------------


> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> 




More information about the MediaWiki-l mailing list