Changes

Jump to: navigation, search

Advanced Wiki Use

7,615 bytes added, 13:59, 30 April 2010
Created page with 'Here are some advanced MediaWiki features: = Namespaces = * MediaWiki supports the concept of namespaces for organizing content * Default namespaces include: ** Main -- Main wi...'
Here are some advanced MediaWiki features:

= Namespaces =

* MediaWiki supports the concept of namespaces for organizing content
* Default namespaces include:
** Main -- Main wiki content
** Template - Used for template text that will be transcluded into other pages
** User - User pages (generally account info, but additonal pages can be created)
** ''Name of Wiki'' - Used for policy information, such as copyright/licensing policy, privacy policy, and so forth
** MediaWiki - Used for special pages, such as the sidebar and configuration options
** Special - Used for special pages generated on-the-fly from the database, such as the list of users, usage statistics, and system messages.
** Each category also has a corresponding Talk page, which contains the Talk pages accessed through the ''Discussion'' tab
* Pages within a namespace are accessed by prepending the namespace name to the page name: <code><nowiki>[[</nowiki>''Namespace'':''Page''<nowiki>]]</nowiki></code> If no namespace is given, the Main namespace is used.

= Categories =

* Categories are collections of related pages.
* Basic syntax (location on the page does not matter): <code><nowiki>[[Category:</nowiki>''category-name''<nowiki>]]</nowiki></code>
* This has two effects:
*# It puts a Category link at the bottom of the page
*# It adds the page to the Category page (a type of Index)
*#* The Category pages does not "exist" until you add some text to it, but it will still show pages in that category even before it "exists". It's a good idea to add introductory text -- even one line -- so the category links don't show in red. If you do this for all legitimate categories, you can spot mistyped category names easily (red links).
* To link to an actual category page: <code><nowiki>[[</nowiki>:Category:''category-name''<nowiki>]]</nowiki></code>

Tips:
* You can nest categories by placing a parent Category link in a Category page. Example:
** Each CDOT Workstation could have it own page, with a <code><nowiki>[[</nowiki>Category:CDOT Workstations<nowiki>]]</nowiki></code> link.
** The ''CDOT Workstations'' page would have a <code><nowiki>[[</nowiki>Category:CDOT<nowiki>]]</nowiki></code> link.
** The ''CDOT'' category page would show ''CDOT Workstations'' as a subcategory.
* You can place category tags in templates
* Categories have their own, distinct namespace

= Transclusion and Templates =

* Transclusion is pulling text into a page from another page (line <code>#include</code> in C++)
* Basic syntax: <code><nowiki>{{</nowiki>''Template''<nowiki>}}</nowiki></code>
* By default, transclusion will pull in pages from the Template namespace
* There are two tags available to control what text is transcluded:
** <code><nowiki><includeonly>''text''</includeonly></nowiki></code> - The text applies only when transcluded. This is useful when you want to include a Category tag in a template, and you don't want the template itself to appear in the category index.
** <code><nowiki><noinclude>''text''</noinclude></nowiki></code> - The text appears only when not transcluded. This is useful for including explanatory text on the actual template page, or when you have a page that may be viewed directly as well transcluded. For example, a page of upcoming lists could include introductory text as well as a bullet list of upcoming events; tagging the introductory text <code><nowiki><noinclude></nowiki></code> will allow just the bullet list to be transcluded.
* Templates may accept arguments; these arguments may then be used within the template as text, filenames, pagenames, or for some other syntax. Arguments are delimited with the vertical-bar (pipe) character. Example: <code><nowiki>{{Admon/note|Unstable API!|This API is marked Unstable, and may change without warning. If you use this API, be prepared to revise your code frequently.}}</nowiki></code> -- which produces:

{{Admon/note|Unstable API!|This API is marked Unstable, and may change without warning. If you use this API, be prepared to revise your code frequently.}}

* Useful templates:
** <code><nowiki>{{Draft}}</nowiki></code> - Marks a page as a Draft (warning users) and adds the page to the Drafts category.
** Admonition templates. These templates accept two arguments, and produce a coloured text box containing an icon, a bold title, and some text.
*** Admon/note - used to mark items of particular note to users. Icon: notepad
*** Admon/tip - used to mark suggestions/tips/ideas for users. Icon: lightbulb
*** Admon/caution - used to mark items the users should be wary of
*** Admon/important - used to mark important notices

= Interwiki Links and Scary Transclusion =

* Links between wikis are supported using InterWiki links. This involves placing a interwiki name in front of the page name (optionally, with a namespace), surrounded by colons: <code><nowiki>[[:fedora:Architectures/ARM]]</nowiki></code>
* Our interwiki table includes entries for the Mozilla MDC/Education wikis and the Fedora wiki, as well as a number of standard wikis (such as Wikipedia and Wicktionary).
* It is also possible to transclude interwiki text: <code><nowiki>{{:''interwiki'':''Page''}}</nowiki></code>

= Page Naming =

* Good page names makes wiki navigation and gardening much easier.
* Choose page names that reflect:
** the fact that the wiki is used/shared between a many different projects
** the (semi-)permanent nature of the wiki and include appropriate versioning.
* You can use path-style namespace division -- for example: Project/Component/Topic
* Pages which are personal versions of drafts/proposal/idea sketches should be placed the User namespace, using a path-style name starting with your name (example: User:Chris Tyler/Drafts/Fedora Arm - Support for armv7tej). Recommendation: use a template to mark all of your personal drafts as drafts and to include them in a personal draft category: <code><nowiki>{{Chris Tyler Draft}}</nowiki></code>

Examples:
{|border="1" cellspacing="0" cellpadding="2" width="100%"
!Bad Title||Better Title
|-
|Ideas for Next Summer||Foo Project Ideas for Summer 2011
|-
|Notes on This Release||Notes on Foo release 1.41
|-
|My Feature Ideas||User:FrankSmith/Ideas/Foo-Features-1.5
|-
|Research Plan||Foo Project/Summer 2010/Research Plan
|}

= Redirects =

* Used to redirect from one page name to another.
* Useful in three situations:
** As trampolines: a standard page name that can be redirected to different pages as circumstances change. Example: <code>Foo Release Notes</code> could redirect to <code>Foo Release 1.41 Notes</code>, and be updated as new releases are issued.
** To make pages easier to find by linking a likely search term to the correct page for that term: <code>SheevaPlug</code> could redirect to <code>Fedora ARM Secondary Architecture</code>, and <code>P.js</code> could redirect to <code>Processing.js Project</code>.
** To allow people to find a page after it is moved (this type of redirect is usually set up automatically).
* Syntax: in the body of the page, place only: <code><nowiki>#REDIRECT [[</nowiki>''Page''<nowiki>]]</nowiki></code>

= Tips =

* Create categories and templates as needed.
* Place every page in one or more categories.
* It can be easier/faster to type a template transclusion than a category tag: <code><nowiki>{{JS}}</nowiki></code> vs. <code><nowiki>[[Category:CDOT JavaScript Projects]]</nowiki></code>
* Templates can be very short. For example, the Fedora project has a template which is simply the current release number.
* Templates can hold any kind of text. They can be used to provide page names or media filenames, for example.

Navigation menu