Extension talk:PageNotice
[edit] Block display on "edit" page?
I just upgraded to MW 1.16, and my bottom-page-notice is now appearing below the bottom of the edit box and above the "save" button. I don't want it to appear at all, but it definitely needs to appear below the save button. Any way to change this? 24.21.209.170 05:16, 16 February 2011 (UTC)
[edit] All articles, except the main page?
Is there anyway to put a message up on all of the articles, except the main page?
[edit] protection needed
--Johnp125 21:27, 4 August 2009 (UTC) Is there a way to put the information on a talk page under a namespace? --Johnp125 21:27, 4 August 2009 (UTC)
if you create a page such as [[MediaWiki:Bottom-notice-ns-0]], you could not protect this page. This could be helpful, if the [[MediaWiki:Bottom-notice-ns-0]] contains a disclaimer for all pages and this disclaimer should only be changed by the administrator.
-
- thanks -- 13:06, 22 February 2008 (MEZ)
[edit] creating new Mediawiki system messages
create a page such as [[mediawiki:new-system-message-name]] and put in it's contents the message you want displayed when the system message is called. thanks to Thomas Daltonmailarchive:mediawiki-l/2008-January/025376.html
-
- thanks -- peblusto 18:27, 3 January 2008 (UTC)
[edit] pages with quote marks " " in the pagename mess up
pages with quote marks " " in the pagename cause the display of an additional <top-notice-pagename> page contents <bottom-notice-pagename>
single quotes in the page name seem okay, so we have a work around by renaming (moving) the page.
does anyone have a solution / resolution permitting this extension to work properly with pages that have quote (") marks in the pagename?
-
- thanks -- peblusto 18:15, 3 January 2008 (UTC)
[edit] PageNotice.php
<?php /** * PageNotice extension - lets you define a fixed header or * footer message for each page or namespace. * * Page notices (headers and footers) are maintained as * MediaWiki-messages. * For page Foo, MediaWiki:top-notice-Foo and * MediaWiki:bottom-notice-Foo can be used to define a * header or footer respectively. * For namespace 6, MediaWiki:top-notice-ns-6 and * MediaWiki:bottom-notice-ns-6 can be used to define a * header or footer respectively. Mind the capitalization. * * For more info see * http://mediawiki.org/wiki/Extension:PageNotice * * @package MediaWiki * @subpackage Extensions * @author Daniel Kinzler, brightbyte.de * @copyright © 2007 Daniel Kinzler * @licence GNU General Public Licence 2.0 or later */ if( !defined( 'MEDIAWIKI' ) ) { echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); die( 1 ); } $wgExtensionCredits['other'][] = array( 'name' => 'PageNotice', 'author' => 'Daniel Kinzler', 'url' => 'http://mediawiki.org/wiki/Extension:PageNotice', 'description' => 'lets you define a fixed header or footer message for each page or namespace.', ); $wgHooks['OutputPageBeforeHTML'][] = 'wfPageNoticeHook'; function wfPageNoticeHook( &$out, &$text ) { global $wgTitle, $wgParser; $name = $wgTitle->getPrefixedDBKey(); $ns = $wgTitle->getNamespace(); $opt = array( 'parseinline', ); $header = wfMsgExt("top-notice-$name", $opt); $nsheader = wfMsgExt("top-notice-ns-$ns", $opt); $footer = wfMsgExt("bottom-notice-$name", $opt); $nsfooter = wfMsgExt("bottom-notice-ns-$ns", $opt); if (!wfEmptyMsg("top-notice-$name", $header)) $text = "<div>$header</div>\n$text"; if (!wfEmptyMsg("top-notice-ns-$ns", $nsheader)) $text = "<div>$nsheader</div>\n$text"; if (!wfEmptyMsg("bottom-notice-$name", $footer)) $text = "$text\n<div>$footer</div>"; if (!wfEmptyMsg("bottom-notice-ns-$ns", $nsfooter)) $text = "$text\n<div>$nsfooter</div>"; return true; }
[edit] Incompatibility with Extension:Ajax Show Editors - MW 1.13 (?)
FYI - when using this with Extension:Ajax Show Editors (MW 1.13.3) we get, for some reason, the bottom notice (namespace 0) at the top of every 'edit this page' view. Since our bottom-notice message is fairly large, this is quite annoying. We have temporarily disabled Ajax Show Editors, but you can contact me via our site to see an example. Version info available here --24.218.221.150 04:50, 17 February 2009 (UTC)
Update: I found an easy way to fix this problem. I added a line {{#vardefine:hidefooter|true}} at the bottom of Hooks.php to the returned wikitext -- this makes use of Extension:VariablesExtension. I then use an #ifeq in the bottom notice (per Extension:ParserFunctions) to hide footer display. --24.218.221.150 13:16, 19 February 2009 (UTC)
[edit] Hide 'edit' links in notice
Any page this shows on includes 'edit' links on the notice. Once you click edit it takes you to the page you were on, and not the notice. It would be best just to hide these edit links altogether.
[edit] Notice before PageTitle
Is it possible to put the pagenotice on the top of the page (before the page title)? - --Ulli 757 22:22, 24 October 2009 (UTC)
[edit] Hide for logged in users?
Is this possible to show only for guests and not registered users? If so, how? Or if there's a better extension that this, tell me please. :) Using MediaWiki 1.15.2 right now. ZTYusei 14:27, 23 May 2010 (UTC)
[edit] Ouch.
This seems to me to carry a substantial performance hit. Without this extension enabled and with page content consisting of an infobox, I generally get page loads between 50-100 ms (as measured by MW's page source benchmark). If I move the infobox to the PageNotice for the namespace, load time balloons to upwards of 650 ms. I'm somewhat familiar with PHP but have no knowledge of MediaWiki internals. Is there a faster call that could be used without impacting accuracy?
-
-
- 68.224.44.77 05:24, 11 August 2010 (UTC)
-
- Nevermind. *sigh* There might indeed be better places to hook in, but due to a constellation of issues these are currently very problematic for this sort of thing.
-
-
- 68.224.44.77 07:08, 11 August 2010 (UTC)
-
-