Layout customization: Difference between revisions
→How do I add a fast text editor like Wikipedia?: Adding a Google Search bar |
/* How do I add a editable Left Menu / by http://www.giswiki.de |
||
| Line 62: | Line 62: | ||
=== How do I add a fast text editor like Wikipedia? === |
=== How do I add a fast text editor like Wikipedia? === |
||
If you know just edit this question. |
If you know just edit this question. |
||
=== How do I add a editable Left Menu === |
|||
====Skin MonoBook==== |
|||
* Insert a new page into the [[:en:Wikipedia:Namespace|Namespace]] '''MediaWiki'''; e.g.. <code>[[MediaWiki:MenuNavigation]]</code> |
|||
* Fill that page with links |
|||
<pre> |
|||
* [[a Link]] |
|||
* [[another Link]] |
|||
* [http://www.Link.de a http-Link] |
|||
</pre> |
|||
* open file skin/Monobook.php |
|||
* look for: |
|||
<pre> |
|||
<h5><?php $this->msg('navigation') ?></h5> |
|||
<div class="pBody"> |
|||
<ul> |
|||
<?php foreach($this->data['navigation_urls'] as $navlink) { ?> |
|||
<li id="<?php echo htmlspecialchars($navlink['id']) |
|||
?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php |
|||
echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?> |
|||
</ul> |
|||
</div> |
|||
</pre> |
|||
* Replace |
|||
<pre> |
|||
<ul> |
|||
<?php foreach($this->data['navigation_urls'] as $navlink) { ?> |
|||
<li id="<?php echo htmlspecialchars($navlink['id']) |
|||
?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php |
|||
echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?> |
|||
</ul> |
|||
</pre> |
|||
with: |
|||
<pre> |
|||
<?php $this->msgWiki( 'MenuNavigation' ) ?> |
|||
</pre> |
|||
* Das Ergebnis sollte fogendermassen aussehen: |
|||
<pre> |
|||
<h5><?php $this->msg('navigation') ?></h5> |
|||
<div class="pBody"> |
|||
<?php $this->msgWiki( 'MenuNavigation' ) ?> |
|||
</div> |
|||
</pre> |
|||
=== How do I add a Google Search bar to the Search Results page? === |
=== How do I add a Google Search bar to the Search Results page? === |
||
Revision as of 14:05, 10 August 2005
Customizing the page layout
This is largely dependent on which skin you're using, how its constructed and which version of mediawiki you have. See Explaining Skins for a brief explanation of Skins.
Questions
How do I customize the Quickbar/Navigation bar?
When using the older table formatted Skin pages, the left hand Quickbar is displayed by the Skin::quickBar function.
When using the newer PHPTal formatted pages, the navigation, search and toolbar blocks are laid out in the template spec file (/templates/xhtml_slim.pt under 1.3; /skins/MonoBook.php under 1.4). Under 1.4 you can add items to the navigation block by manipulating the $wgNavigationLinks array which is defined in /includes/DefaultSettings.php. Any changes should be made in /LocalSettings.php Under 1.3 you can only add items by changing the xhtml_slim.pt file
See Quickbar for more details about editing the Quickbar/Navigation bar ---
How do I customize the logo in the top left corner?
The logo is a portlet block without a pBody section. It is identified by the p-logo id. The background image is specified by the wgLogo variable, which is defined in /includes/DefaultSettings.php. Redefine this in /LocalSettings.php to change the image. However the size of the p-logo will need to be big enough for the logo if it is not to be clipped. This is set in the stylesheet, under the p-logo style, the default setting is:
.
#p-logo {
z-index: 3;
position:absolute; /*needed to use z-index */
top: 0;
left: 0;
height: 155px;
width: 12em;
overflow: visible;
}
but note that a tag is on top of the logo so if you are trying to reduce the size of the logo's portlet you will also need to change the #p-logo a and #p-logo a:hover rules. The default setting for these is:
#p-logo a,
#p-logo a:hover {
display: block;
height: 155px;
width: 12.2em;
background-repeat: no-repeat;
background-position: 35% 50% !important;
text-decoration: none;
}
This simple customization will re-define the size of all of them at once...
#p-logo,
#p-logo a,
#p-logo a:hover {
height: 75px;
}
There is one more rule controlling the amount of space between the logo and first portlet in the side column - the padding on the top of #column-one. By default this is:
#column-one { padding-top: 160px; }
If you want to remove the logo completly, comment out the wgLogo variable. Then set the column-one padding to a small value, such as 21:
#column-one { padding-top: 21px; }
How do I change the icon in the browser's addressline?
See article How do I change the icon in browser's address-line? in MediaWiki_FAQ
How do I add a fast text editor like Wikipedia?
If you know just edit this question.
How do I add a editable Left Menu
Skin MonoBook
- Insert a new page into the Namespace MediaWiki; e.g..
MediaWiki:MenuNavigation
- Fill that page with links
* [[a Link]] * [[another Link]] * [http://www.Link.de a http-Link]
- open file skin/Monobook.php
- look for:
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
<ul>
<?php foreach($this->data['navigation_urls'] as $navlink) { ?>
<li id="<?php echo htmlspecialchars($navlink['id'])
?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php
echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?>
</ul>
</div>
- Replace
<ul>
<?php foreach($this->data['navigation_urls'] as $navlink) { ?>
<li id="<?php echo htmlspecialchars($navlink['id'])
?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php
echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?>
</ul>
with:
<?php $this->msgWiki( 'MenuNavigation' ) ?>
- Das Ergebnis sollte fogendermassen aussehen:
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
<?php $this->msgWiki( 'MenuNavigation' ) ?>
</div>
How do I add a Google Search bar to the Search Results page?
Look here: How to add Google search to your MediaWiki Search Results Page