Thanks so much for that.
Made my day (after big upgrade project from 1.16 to 1.20).
Mike
On May 13, 2013, at 7:04 PM, Dan Fisher wrote:
If it helps, here's the Notitle extension that works for me. Yea I see its not there on mediawiki right now. Save it to, and include this in localsettings: require_once ("$IP/extensions/notitle.php");
<?php
$wgExtensionCredits['parserhook'][] = array( 'name' => 'No title', 'author' => '[http://www.mediawiki.org/wiki/User:Nx Nx]', 'description' => 'Adds a magic word to hide the title heading.' );
$wgHooks['LanguageGetMagic'][] = 'NoTitle::addMagicWordLanguage'; $wgHooks['ParserBeforeTidy'][] = 'NoTitle::checkForMagicWord';
class NoTitle {
static function addMagicWordLanguage(&$magicWords, $langCode) { switch($langCode) { default: $magicWords['notitle'] = array(0, '__NOTITLE__'); } MagicWord::$mDoubleUnderscoreIDs[] = 'notitle'; return true; }
static function checkForMagicWord(&$parser, &$text) { if ( isset( $parser->mDoubleUnderscores['notitle'] ) ) { $parser->mOutput->addHeadItem('<style type="text/css">/*<![CDATA[*/ .firstHeading, .subtitle, #siteSub, #contentSub, .pagetitle { display:none; } /*]]>*/</style>'); } return true; }
}
On Mon, May 13, 2013 at 7:56 PM, Mike Papper bodaro@gmail.com wrote:
The NOTITLE extension is broken. For example: http://www.mediawiki.org/wiki/Extension_talk:NoTitle
So, I would like to change the h1.class as-drawn by my custom skin based on if the article content has the text __NOTITLE__ in it.
Inside the skin, I see a $this parameter but dont know how to access the text within the current page/article from that pointer. Printing the $this shows it is a "ADNSkinTemplate" object (which I dont see a file for in the system, although my sin is named ADNSkin).
Does someone know how I can get at that text to look for the __NOTITLE__ keyword?
Mike
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l