Skip to content

Commit

Permalink
Merge pull request #290 from obuisard/main
Browse files Browse the repository at this point in the history
Auto-start and events information
  • Loading branch information
HLeithner authored Oct 18, 2024
2 parents 32faa30 + 0c4b66d commit 1b32c46
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/general-concepts/guided-tours.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ Note that the Guided Tour component knows how to differentiate category tours fo
There is no available tour when editing a specific module, plugin or template. That is where launching a tour from anywhere can become handy.


### Auto start

Starting with Joomla 5.2, you can set tours to auto start. Those tours will run automatically once a user enters the context of the tour. Once a tour auto starts, the user can hide the tour forever (although the tour can still be run manually), and a cancellation will delay the tour for a later run. Once a specific time has passed (the delay setting can be found in the Global Configuration of the Guided Tours - it defaults to 1 hour), the tour will run again automatically, once in context.


### Event dispatchers

Once a user cancels, opts-out or completes a tour, events are triggered, allowing developers to act according to user actions. One may want to send a message to a user after completion of a tour in order to propose another one, for instance.
Those events are triggered at different stages:
- onBeforeTourSaveUserState: before saving the auto-start tour user state (used to record states in the User Action Logs),
- onAfterTourSaveUserState: after saving the auto-start tour user state.

You can find those events in the AjaxController class.


### Adding images to the content

Use the editor to include images inside the content descriptions. Images are located in the media folder, ```/images``` by default.
However, expecially when creating a tour for a third party extension, you may want to include images located in the media folder of the extension.
In this case, the image path must start with ```media/...```.


## Launching a tour from any location

Launching a tour from a different location than the Guided Tours module is as easy as adding the attribute `data-gt-uid` with the identifier of the tour.
Expand Down

0 comments on commit 1b32c46

Please sign in to comment.