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
Interesting. I was looking for the same answer and I couldn't find it as well.
Luis
On 5/26/06, Kent Sandvik sandvik@gmail.com 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 MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Me too... :-)
Marco
----- Original Message ----- From: "Luis Mandel" luismandel@gmail.com To: "MediaWiki announcements and site admin list" mediawiki-l@wikimedia.org 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 sandvik@gmail.com 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 MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
--
Dr. Luis Mandel luismandel@gmail.com _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
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)
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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
I've added the code but it seem nothing is happend...
Sorry... I'm not a programmer.
----- Original Message ----- From: "Rotem Liss" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@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@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
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" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@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@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Now is ok!! Thank you!!!
Marco
----- Original Message ----- From: "Rotem Liss" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org 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" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@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@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
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 marcor@sorint.it wrote:
Now is ok!! Thank you!!!
Marco
----- Original Message ----- From: "Rotem Liss" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org 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" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@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@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
OK, created a feature request:
http://bugzilla.wikimedia.org/show_bug.cgi?id=6129
---Kent
On 5/29/06, Kent Sandvik sandvik@gmail.com 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 marcor@sorint.it wrote:
Now is ok!! Thank you!!!
Marco
----- Original Message ----- From: "Rotem Liss" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@Wikimedia.org 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" mail@rotemliss.com To: "MediaWiki announcements and site admin list" mediawiki-l@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@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
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
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.
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@lists.wikimedia.org