imported>mutante mNo edit summary |
imported>mutante mNo edit summary |
||
Line 7:
Hi, i have implemented a simple example of your request. check out this: Go to a page on this wiki in [[:Category:GNU]], you should see a GNU head appearing in our logo, unlike on other pages. Also try pages in [[:Category:ASCII]]. Those are just random examples. Source code changes i made follow:
go to /var/www/w/'''skins/MonoBook.php''':
around line 138 fine the part that says
<div class="portlet" id="p-logo">
...
</div>
In there replace the existing code with something like:
<pre>
if (ereg ("GNU",$this->data['catlinks'])) { ?>
<a style="background-image: url(http://s23.org/w/skins/common/images/wiki-gnu.png);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a>
<?php } elseif (ereg ("ASCII",$this->data['catlinks'])){ ?>
<a style="background-image: url(http://s23.org/w/skins/common/images/wiki-ascii.png);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a>
<?php } else { ?>
<a style="background-image: url(<?php $this->text('logopath') ?>);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a>
</pre>
explanation:
if (ereg ("GNU",$this->data['catlinks'])) ... '''if the category links contain "GNU"'''
.. '''set the logo to wiki-gnu.png''' .. <a style="background-image: url(http://s23.org/w/skins/common/images/wiki-gnu.png)
.. you can add more "elseif" lines for other categories you want. You need to change the URLs to your server and and keywords to your categories.
The price shall be a volunatary [[Site_support|donation]] to our Wiki. (or, if you have work lets say the equivalent of what you get for 2 hours of your work in your location).
|
Revision as of 15:50, 16 April 2006
Hello, I have recently customize a style sheet for my wiki, and would love to be able to change out the logo dependant on some property set on the page, the category perhaps. However I have no idea how to do this, and lack the programming skills to try. If anyone knows how to do this, I would be willing to pay (via paypal) anyone that knows how to do this.
My email address is lara@sanctuaryshard.com, please include the cost in your email, and here is the wiki: http://www.sanctuaryshard.com/wiki/index.php?title=Main_Page
Hi, i have implemented a simple example of your request. check out this: Go to a page on this wiki in Category:GNU, you should see a GNU head appearing in our logo, unlike on other pages. Also try pages in Category:ASCII. Those are just random examples. Source code changes i made follow:
go to /var/www/w/skins/MonoBook.php:
around line 138 fine the part that says
...
In there replace the existing code with something like:
if (ereg ("GNU",$this->data['catlinks'])) { ?> <a style="background-image: url(http://s23.org/w/skins/common/images/wiki-gnu.png);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a> <?php } elseif (ereg ("ASCII",$this->data['catlinks'])){ ?> <a style="background-image: url(http://s23.org/w/skins/common/images/wiki-ascii.png);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a> <?php } else { ?> <a style="background-image: url(<?php $this->text('logopath') ?>);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a>
explanation:
if (ereg ("GNU",$this->data['catlinks'])) ... if the category links contain "GNU"
.. set the logo to wiki-gnu.png .. <a style="background-image: url(http://s23.org/w/skins/common/images/wiki-gnu.png)
.. you can add more "elseif" lines for other categories you want. You need to change the URLs to your server and and keywords to your categories.
The price shall be a volunatary donation to our Wiki. (or, if you have work lets say the equivalent of what you get for 2 hours of your work in your location).