Wir empfehlen:


Banner für Sidebar: Unterschied zwischen den Versionen

Aus DadAWeb
Wechseln zu: Navigation, Suche
Zeile 3: Zeile 3:
  
 
Find (line 188):
 
Find (line 188):
 +
<You can add one or more banners to the sidebar by hacking your skins/Monobook.php file (if you're using monobook) to include the following piece of code.
  
?>
+
Find (line 188):
 +
 
 +
?>
 
</div><!-- end of the left (by default at least) column -->
 
</div><!-- end of the left (by default at least) column -->
 
  
 
Include:
 
Include:
  
?>
+
?>
 
<!-- begin of banner1 -->
 
<!-- begin of banner1 -->
 
<div class='generated-sidebar portlet'>
 
<div class='generated-sidebar portlet'>
Zeile 23: Zeile 25:
 
</div><!-- end of the left (by default at least) column -->
 
</div><!-- end of the left (by default at least) column -->
  
 +
Now in your Wiki, create four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)
  
 
Now in your Wiki, create four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)
 
Now in your Wiki, create four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)

Version vom 28. Oktober 2009, 17:41 Uhr

Add a banner to the sidebar (PHP)

You can add one or more banners to the sidebar by hacking your skins/Monobook.php file (if you're using monobook) to include the following piece of code.

Find (line 188): <You can add one or more banners to the sidebar by hacking your skins/Monobook.php file (if you're using monobook) to include the following piece of code.

Find (line 188):

?> </div>

Include:

?>

<?php $this->msg('sidebar-banner1-headingtext') ?>

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

Now in your Wiki, create four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)

Now in your Wiki, create four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...)

parameter value
sidebar-banner1-headingtext The text that will be displayed as the banner heading ("advertisement", "sponsor" etc.)
sidebar-banner1-url The destination URL of this banner
sidebar-banner1-alttext Content of the alt="" parameter of an HTML <img> tag: any title for the destination site
sidebar-banner1-imgsrc Content of 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 (magic words may be used, e.g. {{filepath:banner1.png}}), or the address of an external image

To add more banners, just repeat the process renaming "banner1" to "banner2" etc.