Extension:GuidedTour/Write an extension tour

This page explains how to write an extension tour. This is a ResourceLoader module you bundle into your extension to explain a UI you create or modify. It has full internationalization support, both for the common tour elements and the text you write. You use titlemsg, descriptionmsg, and namemsg to pass in i18n keys for your text.

Examples
The tours currently included in the GuidedTour extension can be viewed or downloaded via gitweb.

General notes
If you will be using GuidedTour, you should list EventLogging, PostEdit, and GuidedTour as dependencies in your README file and your Extension: page on this site.

Once it is a dependency, you must ensure GuidedTour is deployed anywhere your extension is. Remember that GuidedTour has its own localizations, which you may want to check, before deploying GuidedTour to a new wiki.

In many cases, you will want to refer to an existing interface message. MediaWiki lets you easily see the message keys for messages by adding ?uselang=qqx to the URL. For example, try this page. Then, you can include such messages in your own messages using the int magic word.

Adding a tour
Tour names must be unique for all tours on a given wiki, so make sure yours is descriptive. If you are writing a tour for including in the GuidedTour extension, no prefix is necessary. If it is in another extension, prefix it with your extension name to avoid collisions. For example, if your extension is named foobar, use something like foobarfeature.

A new tour should be saved under your extensions modules or resources folder, in a tours subdirectory. For example, resources/tours/foobarfeature.js.

To register it, use code similar to how a JavaScript resource loader is normally registered, but use the naming scheme ext.guidedTour.tour.mytourname. In this example, it would be ext.guidedTour.tour.foobarfeature. If you do not use this module naming scheme, the tour will not load.

You should add the messages you used the normal way (e.g. in FooBar.i18n.php). Be sure to add qqq explanations.

Test tour code walkthrough
This is an annotated walkthrough of a simplified version of the test tour built into Extension:GuidedTour. The test tour does not use any multi-page functionality (see ).

Internationalization messages
These are a few illustrative example messages from GuidedTour.i18n.php. You should also add qqq message descriptions. Follow the link for the rest of the messages, and the qqq examples:

JavaScript walkthrough
This is a walkthrough of a simplified version of the gettingstarted tour. It covers more advanced features not described above: