How to add a banner to the MediaWiki sidebar

From Collectivesolver

Jump to: navigation, search

To add a banner to the MediaWiki sidebar follow the next steps:

1. Find the file MonoBook.php in skins/MonoBook.php path (if you're using monobook)

2. Download the file.

3. Go to line 201 or file the line:
 </div><!-- end of the left (by default at least) column -->

4. Add the next lines of code after the line you find above:

	<!-- begin of banner1 -->
	<div class='generated-sidebar portlet'>
	<h5><?php $this->msg('sidebar-banner1-headingtext') ?></h5>
	<div style="border: 1px solid #B0B0B0; background-color: #FFFFFF;">
	<a href="<?php $this->msg('sidebar-banner1-url') ?>">
	<img width="100%" title="<?php $this->msg('sidebar-banner1-alttext') ?>" 
		alt="<?php $this->msg('sidebar-banner1-alttext') ?>" 
		src="<?php $this->msg('sidebar-banner1-imgsrc') ?>" /></a>
	</div></div>
	<!-- end of banner1 -->
 
	</div><!-- end of the left (by default at least) column -->

5. Create new articles / page named MediaWiki:sidebar-banner1-headingtext and write the banner heading. Example: Sponsor

6. Create new articles / page named MediaWiki:sidebar-banner1-url and write the The destination URL of this banner. Example: http://www.website.com/abc.html

7. Create new articles / page named MediaWiki:sidebar-banner1-alttext and write the alt="" parameter of an HTML <img> tag. Example: Best dog training

8. Create new articles / page named MediaWiki:sidebar-banner1-imgsrc and write the src="" parameter of an HTML <img> tag. The URL of the banner image. It may be the address of an image uploaded to your Wiki {{filepath:banner123.png}}, or the address of an external image. Example: http://www.website.com/banner123.gif

Sponsor
Best 2009 Web Hosting