Remove Main Page header from the main page

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove Main Page header from the main page

Kent Sandvik
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? Thx, Kent
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

luixv
Interesting.
I was looking for the same answer and I couldn't find it as well.

Luis

On 5/26/06, Kent Sandvik <[hidden email]> 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? Thx, Kent
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>


--
-----------------------------
Dr. Luis Mandel
[hidden email]
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Marco Rota
Me too... :-)

Marco

----- Original Message -----
From: "Luis Mandel" <[hidden email]>
To: "MediaWiki announcements and site admin list"
<[hidden email]>
Sent: Friday, May 26, 2006 8:40 AM
Subject: Re: [Mediawiki-l] Remove Main Page header from the main page


> Interesting.
> I was looking for the same answer and I couldn't find it as well.
>
> Luis
>
> On 5/26/06, Kent Sandvik <[hidden email]> 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? Thx, Kent
>> _______________________________________________
>> MediaWiki-l mailing list
>> [hidden email]
>> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>
>
> --
> -----------------------------
> Dr. Luis Mandel
> [hidden email]
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l 

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Brion Vibber
In reply to this post by Kent Sandvik
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
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

signature.asc (257 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Rotem Liss
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
>[hidden email]
>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>  
>
--
#define Name RotemLiss
#define Mail mailSTRUDELrotemlissDOTcom
#define Site www.rotemliss.com


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

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

Sorry... I'm not a programmer.


----- Original Message -----
From: "Rotem Liss" <[hidden email]>
To: "MediaWiki announcements and site admin list"
<[hidden email]>
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
>>[hidden email]
>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>>
>
> --
> #define Name RotemLiss
> #define Mail mailSTRUDELrotemlissDOTcom
> #define Site www.rotemliss.com
>
>


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


> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Rotem Liss
Force-Refresh the Main Page (Ctrl+F5 or Shift+F5).


Marco Rota wrote:

>I've added the code but it seem nothing is happend...
>
>Sorry... I'm not a programmer.
>
>
>----- Original Message -----
>From: "Rotem Liss" <[hidden email]>
>To: "MediaWiki announcements and site admin list"
><[hidden email]>
>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
>>>[hidden email]
>>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>>
>>>
>>>      
>>>
>>--
>>#define Name RotemLiss
>>#define Mail mailSTRUDELrotemlissDOTcom
>>#define Site www.rotemliss.com
>>
>>
>>    
>>
>
>
>--------------------------------------------------------------------------------
>
>
>  
>
>>_______________________________________________
>>MediaWiki-l mailing list
>>[hidden email]
>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>>    
>>
>
>_______________________________________________
>MediaWiki-l mailing list
>[hidden email]
>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
>  
>
--
#define Name RotemLiss
#define Mail mailSTRUDELrotemlissDOTcom
#define Site www.rotemliss.com


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Marco Rota
Now is ok!! Thank you!!!

Marco

----- Original Message -----
From: "Rotem Liss" <[hidden email]>
To: "MediaWiki announcements and site admin list"
<[hidden email]>
Sent: Friday, May 26, 2006 1:05 PM
Subject: Re: [Mediawiki-l] Remove Main Page header from the main page


> Force-Refresh the Main Page (Ctrl+F5 or Shift+F5).
>
>
> Marco Rota wrote:
>
>>I've added the code but it seem nothing is happend...
>>
>>Sorry... I'm not a programmer.
>>
>>
>>----- Original Message -----
>>From: "Rotem Liss" <[hidden email]>
>>To: "MediaWiki announcements and site admin list"
>><[hidden email]>
>>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
>>>>[hidden email]
>>>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>>>
>>>>
>>>>
>>>>
>>>--
>>>#define Name RotemLiss
>>>#define Mail mailSTRUDELrotemlissDOTcom
>>>#define Site www.rotemliss.com
>>>
>>>
>>>
>>>
>>
>>
>>--------------------------------------------------------------------------------
>>
>>
>>
>>
>>>_______________________________________________
>>>MediaWiki-l mailing list
>>>[hidden email]
>>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>>
>>>
>>>
>>
>>_______________________________________________
>>MediaWiki-l mailing list
>>[hidden email]
>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>>
>>
>
> --
> #define Name RotemLiss
> #define Mail mailSTRUDELrotemlissDOTcom
> #define Site www.rotemliss.com
>
>


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


> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Kent Sandvik
Thanks for the recipe, only issue is that if the Monobook.js file
changes between minor MediaWIki versions, this needs to be patched in
over and over again.

I would request if this was a configuration setting in the next
MediaWiki releases, so it could be enabled/disabled per need. Thx,
Kent


On 5/26/06, Marco Rota <[hidden email]> wrote:

> Now is ok!! Thank you!!!
>
> Marco
>
> ----- Original Message -----
> From: "Rotem Liss" <[hidden email]>
> To: "MediaWiki announcements and site admin list"
> <[hidden email]>
> Sent: Friday, May 26, 2006 1:05 PM
> Subject: Re: [Mediawiki-l] Remove Main Page header from the main page
>
>
> > Force-Refresh the Main Page (Ctrl+F5 or Shift+F5).
> >
> >
> > Marco Rota wrote:
> >
> >>I've added the code but it seem nothing is happend...
> >>
> >>Sorry... I'm not a programmer.
> >>
> >>
> >>----- Original Message -----
> >>From: "Rotem Liss" <[hidden email]>
> >>To: "MediaWiki announcements and site admin list"
> >><[hidden email]>
> >>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
> >>>>[hidden email]
> >>>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> >>>>
> >>>>
> >>>>
> >>>>
> >>>--
> >>>#define Name RotemLiss
> >>>#define Mail mailSTRUDELrotemlissDOTcom
> >>>#define Site www.rotemliss.com
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>--------------------------------------------------------------------------------
> >>
> >>
> >>
> >>
> >>>_______________________________________________
> >>>MediaWiki-l mailing list
> >>>[hidden email]
> >>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> >>>
> >>>
> >>>
> >>
> >>_______________________________________________
> >>MediaWiki-l mailing list
> >>[hidden email]
> >>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> >>
> >>
> >>
> >
> > --
> > #define Name RotemLiss
> > #define Mail mailSTRUDELrotemlissDOTcom
> > #define Site www.rotemliss.com
> >
> >
>
>
> --------------------------------------------------------------------------------
>
>
> > _______________________________________________
> > MediaWiki-l mailing list
> > [hidden email]
> > http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> >
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Kent Sandvik
OK, created a feature request:

http://bugzilla.wikimedia.org/show_bug.cgi?id=6129

---Kent


On 5/29/06, Kent Sandvik <[hidden email]> wrote:

> Thanks for the recipe, only issue is that if the Monobook.js file
> changes between minor MediaWIki versions, this needs to be patched in
> over and over again.
>
> I would request if this was a configuration setting in the next
> MediaWiki releases, so it could be enabled/disabled per need. Thx,
> Kent
>
>
> On 5/26/06, Marco Rota <[hidden email]> wrote:
> > Now is ok!! Thank you!!!
> >
> > Marco
> >
> > ----- Original Message -----
> > From: "Rotem Liss" <[hidden email]>
> > To: "MediaWiki announcements and site admin list"
> > <[hidden email]>
> > Sent: Friday, May 26, 2006 1:05 PM
> > Subject: Re: [Mediawiki-l] Remove Main Page header from the main page
> >
> >
> > > Force-Refresh the Main Page (Ctrl+F5 or Shift+F5).
> > >
> > >
> > > Marco Rota wrote:
> > >
> > >>I've added the code but it seem nothing is happend...
> > >>
> > >>Sorry... I'm not a programmer.
> > >>
> > >>
> > >>----- Original Message -----
> > >>From: "Rotem Liss" <[hidden email]>
> > >>To: "MediaWiki announcements and site admin list"
> > >><[hidden email]>
> > >>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
> > >>>>[hidden email]
> > >>>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>--
> > >>>#define Name RotemLiss
> > >>>#define Mail mailSTRUDELrotemlissDOTcom
> > >>>#define Site www.rotemliss.com
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >>--------------------------------------------------------------------------------
> > >>
> > >>
> > >>
> > >>
> > >>>_______________________________________________
> > >>>MediaWiki-l mailing list
> > >>>[hidden email]
> > >>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> > >>>
> > >>>
> > >>>
> > >>
> > >>_______________________________________________
> > >>MediaWiki-l mailing list
> > >>[hidden email]
> > >>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> > >>
> > >>
> > >>
> > >
> > > --
> > > #define Name RotemLiss
> > > #define Mail mailSTRUDELrotemlissDOTcom
> > > #define Site www.rotemliss.com
> > >
> > >
> >
> >
> > --------------------------------------------------------------------------------
> >
> >
> > > _______________________________________________
> > > MediaWiki-l mailing list
> > > [hidden email]
> > > http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> > >
> >
> > _______________________________________________
> > MediaWiki-l mailing list
> > [hidden email]
> > http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> >
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Alexis Moinet
In reply to this post by Kent Sandvik
I changed this in myskin.php (which actually is a copy of monobook.php)

<h1 class="firstHeading"><?php $this->text('title') ?></h1>

becomes

<?php if($this->haveData('title') != 'Main Page'){ ?>
<h1 class="firstHeading"><?php $this->text('title') ?></h1>
<?php } ?>

is that a correct way to do it ?

Kent Sandvik a écrit :
> 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? Thx, Kent

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Rotem Liss
Alexis Moinet wrote:

> I changed this in myskin.php (which actually is a copy of monobook.php)
>
> <h1 class="firstHeading"><?php $this->text('title') ?></h1>
>
> becomes
>
> <?php if($this->haveData('title') != 'Main Page'){ ?>
> <h1 class="firstHeading"><?php $this->text('title') ?></h1>
> <?php } ?>
>
> is that a correct way to do it ?
>  
I think it will work, however you should use wfMsgForContent('mainpage')
instead of the hard-coded 'Main Page', if you change the site language
or just the main page name.

However, I'm not sure you should do that in myskin.php – maybe in
MonoBook.php.

--
#define Name RotemLiss
#define Mail mailSTRUDELrotemlissDOTcom
#define Site www.rotemliss.com


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Remove Main Page header from the main page

Alexis Moinet
Rotem Liss a écrit :
> I think it will work, however you should use wfMsgForContent('mainpage')
> instead of the hard-coded 'Main Page', if you change the site language
> or just the main page name.
thank you, it works better now (it was already working but I hadn't take care of other languages (though I'm a french speaker
:-) ) )
> However, I'm not sure you should do that in myskin.php – maybe in
> MonoBook.php.
Actually, I made a couple of other changes in myskin.php and it's my default skin (and monobook.php is disabled anyway :-) )

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l