官术网_书友最值得收藏!

Changing the Logo

One of the most obvious things that can be done to alter the appearance of your wiki is to change the logo. The following ways can be used to achieve this in MediaWiki:

  • Changing the logo image located at skins/common/images/wiki.png
  • Changing the $wgLogo parameter in the LocalSettings.php file (in the root directory of your MediaWiki installation)
  • Adding the relevant XHTML to your skin's PHP file (for example, skins/ JazzMeet.php)

The Logo File

In MonoBook, the logo is not inserted as an <img> element directly in to the XHTML. It is set as a background image through the use of inline CSS.

<div class="portlet" id="p-logo">
<a style="background-image: url(<?php $this->text('logopath') ?>);" <?php ?>href="<?php echo htmlspecialchars($this->data['nav_urls'] ['mainpage']['href'])?>"<?php echo
$skin->tooltipAndAccesskey('n-mainpage') ?>></a>
</div>

The default size for logo images is 135 pixels by 135 pixels. This is the universal size that is been used for all the default skins that are supplied with MediaWiki.

The Logo File

MediaWiki assumes that the logo is in Portable Network Graphic (PNG) format, although this can be altered.

Note

Portable Network Graphics with a transparent background will not be displayed as intended in Internet Explorer 6.

Of course, with JazzMeet, we will need the logo to be of a different size than the default, as it is rectangular rather than square.

The Logo File

This can be achieved by specifying our own XHTML in JazzMeet's PHP skin template file.

Changing Your Logo in the PHP File

Your wiki's logo can be changed in the PHP template file, stored in skins/. We called this file JazzMeet.php. Find the #p-logo div in this file.

<div class="portlet" id="p-logo">
<a style="background-image: url(<?php $this->text('logopath') ?>);" <?php?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php
echo $skin->tooltipAndAccesskey('n-mainpage') ?>>
</a>
</div>

Replace the content within this div with your own logo XHTML. For JazzMeet, this will be as follows:

<div class="portlet" id="p-logo">
<a  title="JazzMeet">
<img src="skins/jazzmeet/jazzmeet-logo.png" alt="JazzMeet logo" />
</a>
</div>

Note

Replacing the logo in the way just mentioned means that only visitors who are using your wiki's custom skin will be able to see it. If you allow visitors to select other skins, they will not see your wiki's custom logo.

Changing the Logo in LocalSettings.php: $wgLogo

To change your wiki's logo using the LocalSettings.php file, find the line that begins with $wgLogo, and replace its value with the path to your logo image, relative to the root directory of your MediaWiki install. Alternatively, you can specify an absolute path, such as this: http://www.example.com/wiki/skins/jazzmeet/logo.png.

For example, if your wiki has been installed in www.example.com/wiki/, and your logo file is in www.example.com/wiki/skins/jazzmeet/logo.png, the code in the LocalSettings.php file should be as follows:

## Logo file to add (called in TemplateName.php)
$wgLogo = "skins/jazzmeet/logo.png";

Changing the Logo File

By replacing the logo file, wiki.png, in the skins/common/images/ directory, you can instantly change your wiki's logo. This directory is the default location for the wiki's logo, which is used even if the $wgLogo parameter in the LocalSettings.php file is not set.

主站蜘蛛池模板: 清水县| 南京市| 闽清县| 广州市| 南和县| 开封县| 綦江县| 平山县| 张家港市| 阿巴嘎旗| 若羌县| 东乌珠穆沁旗| 韩城市| 涿鹿县| 乐亭县| 新民市| 霍林郭勒市| 夏邑县| 祁东县| 田林县| 益阳市| 海阳市| 石首市| 广东省| 五大连池市| 英超| 邳州市| 安泽县| 武功县| 奉贤区| 麻栗坡县| 佛冈县| 普陀区| 都江堰市| 屯门区| 库尔勒市| 邵阳县| 泾阳县| 嘉兴市| 安龙县| 河津市|