With the module “Tour UI”, I created a custom block to launch “Tour” manually, with the following code :
<a class="btn btn-success btn-sm" href="/?tour"><i class="fa fa-compass fa-lg"></i> Visite</a>
I replaced this module with “D8: Bootstrap Tour”. When should I replace in my customize block to run “Tour” ?
Here is the code provided by the developer of the module :
<script> var tourObject = drupalSettings.bs_tour.currentTour; if (tourObject && tourObject._options.steps.length) { // stop the tour. tourObject.stop(); // start the tour. tourObject.start(); } </script>
Here is the content of my current block :
<a class="btn btn-success btn-sm" href="/?tour"><i class="fa fa-compass fa-lg"></i> Visite</a> <script> var tourObject = drupalSettings.bs_tour.currentTour; if (tourObject && tourObject._options.steps.length) { // stop the tour. tourObject.stop(); // start the tour. tourObject.start(); } </script>
And here is the question asked on drupal.org (see comment #3) :
https://www.drupal.org/project/bs_tour/issues/2933276#comment-12399466