Extension:PCR GUI Inserts

The PCR GUI Inserts extension lets you add pieces of HTML code at the top, bottom or below the sidebar of your wiki, the Graphical user interface (GUI) area. There is no limit to what you can add within these areas.

The idea for this extension came from the observation that adding a simple item to a wiki, like a stat-tracking script or a donation button, although easy in theory is still quite tedious. Before you needed to either:
 * manually edit the skin (all your activated skins, every time you upgrade MediaWiki)
 * install one extension for every feature you want to add. Thus there is the Matomo extension (formerly Piwik), the Google Analytics extension, the Google Adsense extension, the donation button extension, Microsoft Clarity, etc.

Install one extension for every feature causes problems:
 * first, you end up with quite a lot of tiny extensions, and
 * second, sometimes there isn't the extension you need to add one specific element. For example, what if you wanted to insert Ad Bard ads? No extension is able to do this currently.

That's where PCR GUI Inserts is useful: it handles the hooks, and only the hooks, and you handle the HTML code, all the HTML code.

Configuration
By default, the extension won't output anything. You can edit the following settings in LocalSettings.php (add them after the line which includes the extension):

Add to the top of the wiki
$wgPCRguii_Inserts['addHeadItem'] is used to add items at the end of the area. For meta-tags or if you want to add a script at the top:
 * $wgPCRguii_Inserts['addHeadItem']['on']: boolean, whether or not to enable this feature (default: false)
 * $wgPCRguii_Inserts['addHeadItem']['content']: an array of things you want to insert there, for instance:

You will want to keep statistics at the bottom for faster content loading.

Add to the bottom of pages
$wgPCRguii_Inserts['BeforePageDisplay'] adds items at the end of a page, at the bottom but still within the content frame.


 * $wgPCRguii_Inserts['BeforePageDisplay']['on']: boolean, whether or not to enable this feature (default: false)
 * $wgPCRguii_Inserts['BeforePageDisplay']['content']: a string of things you want to insert, for instance:

Add to the bottom of the wiki
$wgPCRguii_Inserts['SkinAfterBottomScripts'] adds items  at the very bottom of a page, below the footer including the "Powered by MediaWiki" button. This is usually where you'll want to add tracking scripts.


 * $wgPCRguii_Inserts['SkinAfterBottomScripts']['on']: boolean, whether or not to enable this feature (default: false)
 * $wgPCRguii_Inserts['SkinAfterBottomScripts']['content']: a string of things to insert there, for example Google Analytics and Quantcast tracking:

Add below the side bar
$wgPCRguii_Inserts['SkinBuildSidebar'] adds items below the side bar. For vertical ads or a donation button.
 * $wgPCRguii_Inserts['SkinBuildSidebar']['on']: boolean, whether or not to enable this feature (default: false)
 * $wgPCRguii_Inserts['SkinBuildSidebar']['content'] example:

Adding a Piwik statistics code at the bottom

 * Example for Piwik 0.9 to 1.7.x


 * Example for Piwik 2.x

Fork

 * Version 3.0.0
 * https://github.com/WikiMANNia/mediawiki-extensions-PCRGUIInserts