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

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.

主站蜘蛛池模板: 咸宁市| 繁峙县| 兴山县| 巧家县| 孝感市| 洪泽县| 林芝县| 肥西县| 手游| 嘉鱼县| 江城| 绥阳县| 沈丘县| 长治市| 泸定县| 墨竹工卡县| 海丰县| 肃宁县| 东明县| 商城县| 光山县| 宁化县| 龙游县| 邳州市| 五峰| 青田县| 绍兴市| 阳西县| 桂阳县| 大名县| 都匀市| 甘洛县| 郸城县| 阿鲁科尔沁旗| 内江市| 确山县| 隆尧县| 茶陵县| 永康市| 南江县| 绥化市|