Banner für Sidebar: Unterschied zwischen den Versionen
(Die Seite wurde neu angelegt: „===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 i…“) |
|||
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
===Add a banner to the sidebar (PHP)=== | ===Add a banner to the sidebar (PHP)=== | ||
+ | [http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#Add_a_banner_to_the_sidebar_.28PHP.29 Originalquelle] | ||
+ | |||
+ | |||
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. | 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): | 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): | ||
+ | <nowiki> | ||
?> | ?> | ||
</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 --> | ||
Zeile 22: | Zeile 27: | ||
<!-- end of banner1 --> | <!-- end of banner1 --> | ||
</div><!-- end of the left (by default at least) column --> | </div><!-- end of the left (by default at least) column --> | ||
− | </ | + | </nowiki> |
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-...) |
Aktuelle Version vom 28. Oktober 2009, 17:44 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><!-- end of the left (by default at least) column --> Include: ?> <!-- 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 -->
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.