Part 3.0 - Organising Content

From Training Material
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Sidebar⌘

The sidebar that appears on the left of every page contains a number of useful tools.

A link to the main page.

A link to recent changes - this shows all recent changes made on the wiki in a similar way to pay history.

Random page - takes you to a random page on the wiki.

Help - an external link to the MediaWiki help page. very useful if you forget how to do something.

What links here - shows all pages that link to the current page. This can be useful for many reasons, i.e fixing redirects.

Related changes - shows all changes made related to the current page.

Upload file - allows you to upload a file, this is disabled by default.

Special Pages - takes you to a list of special pages.

Printable Version - generates a printable version of the page.

Permanent link - link.

Page Information - Gives generally useful information about a page.


Special Pages⌘

Contains special pages, that allow you to view or edit certain parts of the wiki.

For example,

All pages - view all pages

Block users - allows you to block a user from the wiki

User rights management - allows you to see permissions of different user groups.

Localsettings.php⌘

While you probably won't be touching code, its important to be aware of this file as all important changes are made here.

In your mediawiki directory, normally located in /var/www/mediawiki, there will be a file Localsettings.php.

This is your for a number of configuration options, from enabling extensions to defining user permissions.

Categories⌘

A category is a page in the Category namespace

[[Category:category name]]

To include a page in a Category:

 put [[Category:category name]] anywhere on the page

Preferences⌘

There are many User preferences that can be changed in Special:Preferences.

Theres also a link at the top right of all pages.

This can allow you to change a number of options that will only effect your account,

such as skin changing, gadgets, timezone and alot more.


creating a template⌘

To create a template, we simply create a page prefixed with Template:

The template can contain anything you like.

Templates are stored in the Template: namespace.

Using a template⌘

To include a template:

{{TemplateName}}

we can use tags <noinclude> and <includeonly> to specify which parts of the template are included.

we can also pass paramenters into a template:

Written by : {{{Name|}}}

we include it with a parameter:

{{Footer|Name=David}}

When to use a template⌘

Footer/Header

Info box

Navigation boxes

Generally items that will appear on more than 1 page

Wikipedia uses info box templates on many pages.

http://en.wikipedia.org/wiki/Template:Infobox_person

Templates

Create new page Template:Footer in Template namespace:

----
Made from organic source code.

Use it on normal page:

{{Footer}}


Create Template:Table template:

{| class="wikitable" width="500"
! colspan="2" | {{{ Title }}}
|-
| Description
| {{{ Description }}}
|-
| Duration
| {{{ Duration | 7 hours }}}
|-
| Prerequisites
| {{{ Prerequisites | Basic knowledge of computer use.}}}
|}

Use it and assign values to the variables:

{{
Table
| Title=MediaWiki for Content Editors
| Description=MediaWiki course for power users
| Duration=14 hours
}}

Namespaces⌘

Namespace's are used to distinguish between different types of content.

Namespace is shown as a prefix to the page name, e.g Talk:MyPage

A Namespace seperates out your content, so a page MyPage in the Talk namespace is different to MyPage in the Main namespace.

You can't create a namespace by trying to create any page with a prefix.

It needs to been created in your Localsettings.php file, and should rarely be done.

define("NS_NAME", 44);

$wgExtraNamespaces[NS_NAME] = "Name";


It's important to make sure that the number is not used by any other namespace, by default -1 - 15 are used.

Skins⌘

You can a skin to change the appearance of your wiki.

You can set a default skin, and by default users can choose there own skin in Special:Preferences#mw-prefsection-rendering

Custom CSS and JavaScript⌘

Custom CSS can be added on MediaWiki:Custom.css and MediaWiki:custom.js pages.

http://www.mediawiki.org/wiki/Manual:CSS

Exercise ⌘

  • Move date into a footer Template.
  • Add footer template to all your pages.
  • Create a cheese category and add your pages to it.
  • create a Food Category and add your "cheese" page to it.

Links

Internal link to another page: Main Page

[[Main Page]]

Internal link to another page with custom name: Go to Main Page

[[Main Page| Go to Main Page]]

Internal link to section on current page: Go to Templates section

[[#Templates| Go to Templates section]]

Internal link to section on another page: Go to Templates section on MediaWiki for Content Editors page

[[MediaWiki for Content Editors#Templates| Go to Templates section on MediaWiki for Content Editors page]]

External link with custom name: Apple Inc.

[http://apple.com Apple Inc.]

Image link:

[[File:Arduino logo.png| link=http://arduino.cc]]

Magic words and variables

Disable edit section on page:

__NOEDITSECTION__

Force showing Table of Contents:

__FORCETOC__

Get number of pages:

{{NUMBEROFPAGES}}

Redirects

Create redirect:

#REDIRECT [[New Page]]

Customization

  • Custom CSS styles can be added to MediaWiki:Common.css page in MediaWiki namespace.
  • Custom JavaScript code can be placed on MediaWiki:Common.js page in MediaWiki namespace.
  • Sidebar can be changed on page MediaWiki:Sidebar in MediaWiki namespace.