Extension talk:NoTitle/LQT Archive 1

Doesn't work for 1.10. 66.31.209.239 23:55, 6 June 2007 (UTC)

Confirmed. Someone please fix this or look at it! I'd love to have a working version. Changing the stylesheet is such a crude solution to this problem and it affects all pages instead of selective ones. 216.99.65.63 18:35, 2 August 2007 (UTC)
 * Problem solved, it still uses CSS but it works for 1.10 now, just look under Known Problems and use that php instead of the normal script. I've only tested on version 1.10 so far so if someone wants to try it out on a lower MW version plz let me know how it goes! --Diploid

Error messages (1.10)
Works sometimes on 1.10, but not on all pages. Errors:

Notice: Undefined variable: action in /var/www/bkwiki/extensions/NoTitle/NoTitle.php on line 38

Notice: Undefined variable: action in /var/www/bkwiki/extensions/NoTitle/NoTitle.php on line 38

Notice: Undefined property: ParserOptions::$mHideTitle in /var/www/bkwiki/extensions/NoTitle/NoTitle.php on line 46

Notice: Undefined variable: action in /var/www/bkwiki/extensions/NoTitle/NoTitle.php on line 38

-- Bjoern, 14. Jul 2007 00:02


 * I had this same problem, try my patch at the bottom of the page, it fixed it for me.
 * --Diploid 18:50, 14 August 2007 (UTC)

How to disable caching?
This extension is used on the http://uncyclopedia.info main page, and it seems that once a huge cache (APC) was added to the site, the page title started displaying whenever the user hit reload/refresh in the webbrowser.

I've kludged around this problem by using the random selection algorithm (or any other tag or item that forces a cache disable) on the affected MW1.11 pages, but perhaps this extension itself should be patched to turn off the parser cache on any page on which it is invoked? --Carlb 12:29, 16 July 2007 (UTC)
 * There is a better way: craft an extension that looks for a 'magic word' in the hook 'OutputPageBeforeHTML' and triggers code in the hook 'SkinTemplateOutputPageBeforeExec' to blank the title (can't really remove the HTML completely without a code hack); parser cache friendly solution. Jean-Lou Dupont 18:50, 2 August 2007 (UTC)
 * Use Extension:PageFunctions if you wish to change the page's title whilst respecting parser caching. Jean-Lou Dupont 19:05, 2 August 2007 (UTC)


 * Easy way - just add one line $parser->disableCache; right after the mHideTitle=true; is set. That fixes this bug. Tested and working on uncyclopedia.info under APC and MW1.11alpha --Carlb 17:43, 5 August 2007 (UTC)

Doesn't work for 1.11. 81.53.23.145 12:49, 2 September 2007 (UTC)

Bug with 1.11
Doesn't seam to work with the latest mediawiki version... any idea when this will be fixed ? : ) Here is what I get: MediaWiki internal error.

Original exception: exception 'MWException' with message 'Detected bug in an extension! Hook NoTitle::addMagicWordId failed to return a value; should return true to continue hook processing or false to abort.' in SERVERPATH/mediawiki/includes/Hooks.php:133 XApple 11:59, 25 November 2007 (UTC)


 * I've seen this with various extensions and recent MW1.12 releases; usually adding "return true;" at the point where the offending routine ends will make this go away. --Carlb 23:10, 25 January 2008 (UTC)

I used a snippet of this extension to hide the Main_Page title

 * MediaWiki: 1.11.1
 * PHP: 5.2.3 (apache2handler)
 * MySQL: 5.0.51a
 * URL: DishiWiki

From the Article (Extension) page:

"You can remove the "Main Page" title on the front page by including the following in MediaWiki:common.js

In many cases, this bypasses the need for the extension. (Emphasis added by this user.)

/** Main Page layout fix ******************************************************* * * Description: UNDOCUMENTED * Maintainers: UNMAINTAINED * The following code was pulled from Wikipedia's http://en.wikipedia.org/wiki/MediaWiki:Common.js, and is used to * supress the title on the main page. var mpTitle = "Main Page"; var isMainPage = (/(title=|\/wiki\/)([Tt]alk:|)[Mm]ain[ _][Pp]age/.test(document.location)); var isMainPageFront = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle); var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1)); if (isMainPageFront && !isDiff) { document.write('/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/ '); addOnloadHook( appendOtherLanguageLink ); } /**/

Placing only the snippet (above) in my Mediawiki:common.js page indeed hid the title of Main_Page. As stated in the article, I did not have to install the Extension itself. But the code above caused the non-fatal "Javascript error on page" using Internet Explorer 7: "appendOtherLanugageLink" not defined." So I removed the line

addOnloadHook( appendOtherLanguageLink );

which removed the Javascript error. I have not experienced any other problems yet. (For unknown reason(s), I had not been able to hide the title of the Main_Page using any other method.)

- Brian7632416 19:41, 11 May 2008 (UTC)


 * This fix worked extremely well on MW1.12 as well. Thanks, Brian7632416! --Ishmayl 22:15, 19 May 2008 (EDT)
 * Doesn't work for 1.15.2 --Mark 12:21, 1 April 2010 (UTC)

1.14 alpha
Works on the above, except right after installing, something strange happened: Special:Version came up empty. Had to revert, uncommenting require_once. Also can't make it transclude through templates. Any clues? —Sasoriza 06:40, 9 October 2008 (UTC)

Wish List
This is a good extension that deserves a little more work to make it really great. A few suggestions that I have include: Thanks, --PerkinsTaylor 05:00, 11 March 2009 (UTC)
 * Don't limit the extension to the only the title: As long as you can find the names of the CSS classes, it is really easy to expand the extension to include &#95;_NOCAT__ (a magic word to hide the category links section at the bottom of the page), &#95;_NOTABS__ (a magic word to hide the tabs at the top of the page), or any number of other page elements.
 * Try not to tie the extension to any particular skin: Instead of hard coding CSS class names, consider using variables that pull class names from a separate .i18n file (similar to how messages are switched in extension like Extension:ParserFunctions). That way, others can append the .i18n file to suit alternate or growing needs.
 * Take a look at how the code goes through the parser: I found, like Sasoriza's comment in 1.14 alpha, above, that the extension doesn't work through transclusion. I also found that that &#60;nowiki> tag (&#60;nowiki>&#95;_NOTITLE__&#60;/nowiki>) does not keep the magic word from functioning.  I suspect that each of these has to do with parsing.

Doesn't Work in 1.15.1 or 1.16alpha
After upgrading our private wiki from 1.12 to MW 1.15.1, the __NOTITLE__ magicword is simply ignored. I created a sandbox copy of my wiki and patched it with 1.16alpha but still got the same result. Yes, before you ask, I have replaced my original NoTitle.php with the updated MW 1.13-corrected code (as found on this Extension page in the "MediaWiki 1.13" section.) Has anyone else had this problem, and does anyone have a fix? I'm plowing my way through .php and .css but I'm not exactly a PHP/CSS expert (I may become one after this is all over!) There's obviously a lot of differences with the Parser from 1.13 onward. Any comments, thoughts, help would be appreciated... I might even regard obscene catcalls in a constructive light at this point. ApostleGreen 22:16, 28 July 2009 (UTC)

Manual:Hooks shows that MagicWordMagicWords has been deprecated. I'll perhaps look into a fix later. andrewdodd13 12:28, 4 August 2009 (BST)

NoTitle 1.13-corrected code works with Mediawiki 1.15.1. --62.47.133.219 15:41, 18 August 2009 (UTC)

Modification for gumax skin
If you're using the gumax skin, see http://forum.paulgu.com/viewtopic.php?f=6&t=368&p=1728#p1728 on how to make it work...

Transclusion of __NOTITLE__ doesn't work
Hi I'm trying to transclude a page with __NOTITLE__ in it into another page, such that the second page doesn't show the title. The page with __NOTITLE__ in it works fine (shows no title), but the page that is trancsluding the original page simply shows "__NOTITLE__" as plain text and doesn't pick it up as a magic word. Any suggestions on how to fix that? -- RichardJ87 Hi Richard.

I got it to work by adding the extra hook: $wgHooks['ParserBeforeTidy'][] = array($NoTitle, 'checkForMagicWord'); before: $wgHooks['ParserAfterStrip'][] = array($NoTitle, 'checkForMagicWord'); -- mitchelln

Alternate method without having to use the extension below
Add the following code below to your monobook.css (MediaWiki:Monobook.css) Modifying the Nameofpage to match the page you want to not show the title.

/* Removing the Main Page title from the main page. */ body.page-Nameofpage #siteSub, body.page-Nameofpage #contentSub, body.page-Nameofpage h1.firstHeading { display: none !important; }

A minor bug, a couple of annoyances and a showstopper
EDIT: Nevermind, problems seem to have been fixed using the 1.13 version.

MW 1.16b
it seem that this doesn't work for the above version.:-(     Msevero 07:19, 16 March 2010 (UTC)


 * Not working for me either. Any chance of getting this fixed?
 * Thanks mitchelln 15:19, 24 March 2010 (UTC)


 * I can't get it to work either. I've tried the Common.js fix and no joy there either. Since both Wikipedia (now using 1.16) and MW both have their Main Page title suppressed, there surely has be a relatively straightforward fix for this. I'd very much appreciate advice on it. --Sabretache 08:18, 7 May 2010 (UTC)


 * MW and Wikipedia suppress it via css:

body.page-Main_Page h1.firstHeading { display: none; }
 * However it only works for the main page. Cheers --kgh 09:11, 7 May 2010 (UTC)

Mediawiki 1.15.2
When used the Version Special Page doesn't show any information. --Mark 12:10, 1 April 2010 (UTC)