Extension talk:PageNotice/Archive

Block display on "edit" page? edit

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)Reply

I just installed this extension and have a similar problem on MW 1.17. It is resulting in me not being able to save any pages. Has anyone found a resolution to this issue? --Jcantroot (talk) 19:56, 27 July 2012 (UTC)Reply
To append my statement, the "save page" function is working well as long as I do not include an inputbox. I was trying to include a specific search on each page of a namespace with this header and that caused pages to not save.--Jcantroot (talk) 20:12, 27 July 2012 (UTC)Reply

All articles, except the main page? edit

Is there anyway to put a message up on all of the articles, except the main page?

Yes please.--Cihuaweb (talk) 09:06, 11 August 2015 (UTC)Reply
Yea I concur; a feature where you can add an exception to not display the notice on a particular page would be great 09:05, 1 June 2016 (UTC)

protection needed edit

--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)Reply


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)


creating new Mediawiki system messages edit

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)Reply


pages with quote marks " " in the pagename mess up edit

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)Reply

PageNotice.php edit

<?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;
}


Incompatibility with Extension:Ajax Show Editors - MW 1.13 (?) edit

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)Reply

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)Reply

Hide 'edit' links in notice edit

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.

Notice before PageTitle edit

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)Reply

Hide for logged in users? edit

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)Reply

Ouch. edit

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)Reply
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)Reply

PageNotice conflict with the Foreground Skin edit

If you're using the Foreground Skin this extension will cause the Preview Function to fail inside a Semantic Form.Christharp (talk) 01:44, 24 February 2014 (UTC)Reply

style module should define its position explicitly edit

FYI I'm getting this warning in MW 1.26.0 (don't know if it existed earlier, just installed this extensions):

Warning OutputPage::getModuleStyles: style module should define its position explicitly: ext.pageNotice ResourceLoaderFileModule

This is a reference for fixing I found:

https://www.mediawiki.org/wiki/Topic:Sprswqpt682hyjki

To fix the error, add the following to "PageNotice.php" after line 42:
'position' => array(
'top',
),
The "new" $wgResourceModules looks like:
$wgResourceModules['ext.pageNotice'] = array(
   'position' => array(
       'top',
   ),
   'styles' => array(
       'modules/ext.pageNotice.css',
   ),
   'localBasePath' => $dir,
   'remoteExtPath' => 'extensions/PageNotice',
);
--Dknapke (talk) 13:20, 18 January 2016 (UTC)Reply
When using it, i got the notice: "Array to string conversion in \includes\resourceloader\ResourceLoaderFileModule.php on line 285", so i have deleted the array and everything works fine.
$wgResourceModules['ext.pageNotice'] = array(
   'position' => 'top',
   'styles' => array(
       'modules/ext.pageNotice.css',
   ),
   'localBasePath' => $dir,
   'remoteExtPath' => 'extensions/PageNotice',
);
--Dknapke (talk) 10:06, 4 February 2016 (UTC)Reply

Add message to Special pages edit

I have a short footer message that links to a feedback form so my end users can provide suggestions for new content or modifications for the current page. This works great when they actually get to a page however it's not so great when they're searching and can't find what they're looking for. In this instance, I'd like to have a header and/or footer message on the search results page that directs them to the feedback form.

According to Manual:Namespace, the numeric namespace ID for Special is -1 however creating a page called MediaWiki:top-notice-ns--1 does not have the desired effect.

Is there any way to add page notices to special pages? Benhinc (talk) 17:43, 7 August 2017 (UTC)Reply

Agreed, I need to add it to the Special namespace too. --Anrake (talk) 14:45, 19 January 2018 (UTC)Reply

Return to "PageNotice/Archive" page.