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

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.

主站蜘蛛池模板: 固镇县| 乐亭县| 巫溪县| 开封县| 巨鹿县| 吕梁市| 出国| 墨江| 旺苍县| 合水县| 焉耆| 连江县| 龙南县| 仪陇县| 宜都市| 九龙坡区| 延津县| 商河县| 武平县| 湘潭市| 博湖县| 连江县| 泉州市| 卓尼县| 若羌县| 新疆| 沾益县| 梅河口市| 永安市| 宁蒗| 蓝山县| 广南县| 同心县| 拜泉县| 嵊州市| 上虞市| 怀来县| 陇南市| 卫辉市| 蒲城县| 稷山县|