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 via Gitiles.

General notes
If you will be using GuidedTour, you should list EventLogging 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 en.json and qqq.json). Be sure to add qqq explanations.

Test tour code walkthrough
This is an annotated walkthrough of the 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. You should also add message descriptions. Follow the 'en' link for the rest of the messages, and the 'qqq' one for the message descriptions:

The first line below is an example of how to refer to the text of an existing interface element, in this case the edit button.

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