Manual:Interface/Sidebar/Hacks

This page lists hacks that used to be mentioned in Manual:Interface/Sidebar. These have been removed because they involve modifying the core .php code and are not supported. They are only here for historical interest.

Change sidebar content when logged in (PHP)
In your LocalSettings.php file, use the SkinBuildSidebar hook to modify the sidebar. Edit this function to check for $wgUser->isLoggedIn and call a different system message than sidebar.

Then in your Wiki, go to MediaWiki:anon_sidebar and create your new sidebar.

Allow wiki markup (PHP)
Many people on support desk have been asking about how to put arbitrary wikitext into the side bar. You can hack your skins/Vector/VectorTemplate.php file (if you're using Vector) and replace the following section of code.

MediaWiki 1.27
Replace this: with this:

Content of MediaWiki:Sidebar
That will allow the MediaWiki:Sidebar article to be proper wikitext. You will need to include the 'pBody' div tag to ensure the portlet is styled correctly, so your MediaWiki:Sidebar article will need to look something like the following example after the change: Navigation
 * Main Page
 * Community portal
 * [ Recent changes]
 * Sandbox
 * Help