Manual:FAQ

Manual:FAQ

From PaulGuWiki

Jump to: navigation, search

Contents

Installation And Configuration

Where do I download MediaWiki skin GuMax?

The latest stable release of GuMax can be downloaded from Mediawiki Skins. Files are supplied in a zip archive.

How do I install MediaWiki skin GuMax?

Installing GuMax takes between 3 and 5 minutes, and involves uploading/copying files, and edit configuration file.

Full instructions can be found in the Manual:Installing GuMax.

How do I create a new MediaWiki skin?

This requires PHP and CSS programming skills.

Full instructions can be found in the Manual:Creating MediaWiki Skin.

Changing the Interface

How do I change the logo?

The logo that appears in the top left of each page is determined by the $wgLogo configuration setting in the LocalSettings.php file.

To change this you simply need to change the value of $wgLogo to point to the URL of your own logo image. You can upload a file via the wiki and use that address (which allows it to be replaced easily, so you may want to protect the page if you use this method) or use an image uploaded to your server via other means.

Caution! Caution: It is possible to simply overwrite the default logo installed with GuMax, but this is strongly advised against, as an upgrade may end up overwriting it or change the default location of this file.

Tip: The logo image should be 180x72 pixels square.

How do I add extra namespaces?

To add a namespace, modify your LocalSettings.php file, and add namespaces via $wgExtraNamespaces. You can add the following code to add a "Portal" namespace, and it's corresponding discussion namespace:

$wgExtraNamespaces = array(100 => "Portal", 101 => "Portal_talk");

Note Note: Be sure to add underscores instead of spaces, such as in Portal_talk. Otherwise, the namespace will not be declared properly!

How do I purge a cached page?

To purge a cached page, such as when making changes to the navigation bar, add &action=purge to the end of the page url.

e.g. http://www.paulgu.com/w/index.php?title=Home&action=purge

How do I hide the main page title?

MediaWiki does not have a built-in option to hide the main page title. Instead you must use JavaScript or CSS.

In 1.9 and above, you can rely on CSS to hide it. Replace "Main_Page" with the appropriate page name, here with spaces replaced by underscores.

body.page-Main_Page h1.firstHeading { display:none; }

If that doesn't work, look at the HTML source code to find the correct class to replace "page-Main_Page" with:

<body class="mediawiki ns-0 ltr page-Some_title">

If no such class exists, then you cannot use this feature. You may be using a custom or outdated skin.

How do I hide the table of contents?

For one page

Place the magic word __NOTOC__ into the page markup.

For all pages

Edit the CSS files; locate the style for the table of contents and add display: none; to the definition.

Per user

Users can also opt to have the table of contents hidden. This is a user preference, set in Special:Preferences.

How do I remove the article/edit etc tabs for users who are not logged in?

You can achieve this by modifying the skin. For the default MonoBook skin, in the MonoBook.php file, search for this line:

foreach($this->data['content_actions'] as $key => $tab) {

and insert after $tab) this

if($this->data['loggedin']==1)

had to place inside the <?php). So it looks like this:

foreach($this->data['content_actions'] as $key => $tab) if($this->data['loggedin']==1) {

To conditionally hide individual tabs, modify the code to check the value of each $key inside the foreach loop. Or you can write a 'hook' extension (around SkinTemplateXYZ) to modify the tab list.

How do I add/remove tabs in general?

To (for example) remove the talk tab and then add one that always goes to the main page you would save this code in (for example) extensions/AR-Tabs.php:

$wgHooks['SkinTemplateContentActions'][] = 'ReplaceTabs';
 function ReplaceTabs ($content_actions) {  
  unset( $content_actions['talk'] );    //only this to remove an action
     $maintitle = Title::newFromText(wfMsg('mainpage') );
      $main_action['main'] = array(
        'class' => false or 'selected',    //if the tab should be highlighted
        'text' => wfMsg('sitetitle'),     //what the tab says
        'href' => $maintitle->getFullURL(),   //where it links to
      );
      $content_actions = array_merge( $main_action, $content_actions);   //add a new action
 }

and then add

require_once("extensions/AR-Tabs.php");

to the bottom of LocalSettings.php

How do I remove the "Create an Account or Login" link at the top right of the screen?

In Monobook.php change this statement:

foreach($this->data['personal_urls'] as $key => $item) {

to:

foreach($this->data['personal_urls'] as $key => $item)  if($this->data['loggedin']==1) {

How do I hide the section edit links for users who are not logged in?

Edit your skin, eg MonoBook.php, and add this before </head>:

<?php if(!$this->data['loggedin']) { ?>
      <style>
        .editsection { display: none; }
      </style>
 <?php } ?>

If you want to hide the links for all users including logged in users, instead edit monobook/main.css and add .editsection { display: none; }

A far better way to do this is by editing your LocalSettings.php file and changing the default setting for the display of these section edits. Then it will apply to all skins, not just the default one you have selected for your wiki. What is required is to add the following line of code to the LocalSettings.php file:

$wgDefaultUserOptions ['editsection'] = 0;