Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules

Search

Donate to XOOPS!

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Git Google GUI hacks instant-zero jQuery module mygalleries news Nordic Olédrion oxygen PageRank PHP rmcommon security SEO simple-XOOPS Smarty sport tag Theme tutorial wiki WOX xoops XoopsEngine ZendFramework

New Users

Registering user

# 133948

guilhermeans

Welcome to XOOPS!
[Main Page]

Layout customization

From XOOPS Web Application System

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: MediaWiki Development

This content is being progressively moved to Help:FAQ#Changing_the_Interface on MediaWiki.


Contents

Customizing the page layout

This is largely dependent on which skin you're using, how it's constructed and which version of mediawiki you have. See Explaining Skins for a brief explanation of Skins.

Questions

How do I remove the toolbox for users that are not logged in?

Edit the file: /skins/MonoBook.php Find the section that looks like this (by searching for p-tb):

        <div class="portlet" id="p-tb">
		<h5><?php $this->msg('toolbox') ?></h5>

Replace with this:

        <div class="portlet" id="p-tb">
        <?php if($this->data['loggedin']) { ?>
		<h5><?php $this->msg('toolbox') ?></h5>

Go down to the bottom of the div block that you are editing and find the section that looks like this:

		wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
?>
			</ul>
		</div>
	</div>

and add the line (between the two /div's) that closes off your new "if" statement:

		wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
?>
			</ul>
		</div>
        <?php } ?>		
	</div>

How do I remove the special page tab?

Edit the file: /includes/SkinTemplate.php

Change the following section:

        /* show special page tab */

			$content_actions['article'] = array(
				'class' => 'selected',
				'text' => wfMsg('specialpage'),
				'href' => $wgRequest->getRequestURL(), // @bug 2457, 2510
			);


(by commenting out the whole block) to:

        /* show special page tab 

			$content_actions['article'] = array(
				'class' => 'selected',
				'text' => wfMsg('specialpage'),
				'href' => $wgRequest->getRequestURL(), // @bug 2457, 2510
			);*/

How do I change the "content page", "discussion", etc. tags at the top of the page?

The file includes/SkinTemplate.php contains a function that builds the list called buildContentActionUrls. It decides what tabs to include for a given page and what code to run when the user clicks on a tab.

How do I add an editable Left Menu?

See also mw:Manual:Navigation bar.

Skin MonoBook

New: Under 1.5 you just need to edit MediaWiki:Sidebar, see the line in format of link|Display name

The Sidebar is located at http://<yourhost>/wiki/index.php/MediaWiki:Sidebar

See Quickbar for more details about editing the Quickbar/Navigation bar

Note that the method below gives you more flexibility over the layout of the menu, such as including horizontal rules and sub-bullets, than the Sidebar menu... ---

  • Insert a new page into the Namespace MediaWiki; e.g. MediaWiki:MenuNavigation (the easiest way to do this is to create a link on your wiki with that page name. Alternately, typing the url http://www.wikiurl.net/index.php?title=Layout_customization&action=edit (replacing www.wikiurl.net with your own URL)). You must have SysOp privileges to do this.
  • Fill that page with links
  * [[Main Page]]
  * [[Special:Recentchanges| Recent changes]]
  * [[Special:Random| Random page]]
  ** [[an indented Link]]
<hr>
  * [[another Link]]
  * [http://www.Link.de a http link]
  • open file skins/Monobook.php
  • look for:
     <h5><?php $out = wfMsg( $bar ); if (wfNoMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
     <div class='pBody'>
       <ul>
       <?php foreach($cont as $key => $val) { ?>
         <li id="<?php echo htmlspecialchars($val['id']) ?>">
         <a href="<?php echo htmlspecialchars($val['href']) ?>">
         <?php echo htmlspecialchars($val['text'])?></a></li>
        <?php } ?>
       </ul>
     </div>
  • Replace
       <ul>
       <?php foreach($cont as $key => $val) { ?>
         <li id="<?php echo htmlspecialchars($val['id']) ?>">
         <a href="<?php echo htmlspecialchars($val['href']) ?>">
         <?php echo htmlspecialchars($val['text'])?></a></li>
        <?php } ?>
       </ul>

with:

      <?php $this->msgWiki( 'MenuNavigation' ) ?>
  • The result should look like:
  <h5> <?php $out = wfMsg( $bar ); if (wfNoMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
     <div class='pBody'>
       <?php $this->msgWiki( 'MenuNavigation' ) ?>
     </div>

This will remove the old Navigation menu and replace it with whatever you built in the MediaWiki:MenuNavigation page. If you want to keep the old Navigation menu functions and just add new ones, you must either duplicate the links in MediaWiki:MenuNavigation -OR- rather than replace the code section as described above, you must add the new code on its own line above or below the old code section.

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

How do I move the location of the search box?

This is for the Monobook theme and involves modifying the Monobook.php file - you can see the effect here.

  • Find and select the following code in MonoBook.php:
<div id="p-search" class="portlet">
	  <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
	  <div class="pBody">
	    <form name="searchform" action="<?php $this->text('searchaction') ?>" id="searchform">
	      <input id="searchInput" name="search" type="text"
	        <?php if($this->haveMsg('accesskey-search')) {
	          ?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
	        if( isset( $this->data['search'] ) ) {
	          ?> value="<?php $this->text('search') ?>"<?php } ?> />
	      <input type='submit' name="go" class="searchButton" id="searchGoButton"
	        value="<?php $this->msg('go') ?>"
	        /> <input type='submit' name="fulltext"
	        class="searchButton"
	        value="<?php $this->msg('search') ?>" />
	    </form>
	  </div>
	</div>
 
  • Move it either up or down in the page code, depending on where you want it positioned.
  • A good place to put the search box is just below the logo. To do this, move or copy the above code directly below where you find the following:
 	<div class="portlet" id="p-logo">
	  <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>
	</div>

Custom Headers

To create a custom header you need to modify the specific skin.php file. The default is skins/Monobook.php. However, when you upgrade Mediawiki this file will be overwritten, so to ensure that your custom header will remain in place after future upgrades you should create a new custom skin first, and modify that instead of modifying the default Monobook skin. You can easily and quickly create a skin based on Monobook by following the instructions at http://meta.wikimedia.org/wiki/Skins - this is a quick 5 minute task. Remember to change the site default skin in Localsettings.php to your new skin.

When you are ready, add your header code in the specific skin.php file as a <div> section immediately before <div id="globalWrapper">.

You then need to amend your skin’s CSS file: main.css. If there are any styles associated with your header then these should be added into main.css, and you will also need to add the following two properties and values to the selector #globalWrapper: {position:absolute; margin-top:0;} which will ensure that the existing wiki content moves down beneath your new header. You may find that you need to make some other CSS adjustments such as to font sizes in the body {} selector. This is if you forget to add a semicolon ";" to the end of each statement, because forgetting to do so invalidates the statement "font-size: 127%;" on the following line (for those who added from the top).

How do I change background?

(Monobook) Edit body tag style sheet in /monobook/main.css file:

body { background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat;

Edit background image /monobook/headbg.jpg.

How do I change the edit toolbar?

see here: Customizing Edit Toolbar


Retrieved from "http://xoops.org/modules/mediawiki/index.php/Layout_customization"

This page has been accessed 2,913 times. This page was last modified 06:35, 20 November 2007. Content is available under XOOPS Web Application System.