How to create a custom block, to launch a visit?

by 3cfe5693   Last Updated January 13, 2018 15:07 PM

I want to create a button in the side navigation bar, to launch a visit manually.

So I created a block and put the following code in it :

<button class="btn btn-success btn-sm" data-role="start"><i class="fa fa-compass fa-lg"></i> Commencer la visite</button>

<script>
var tourObject = drupalSettings.bs_tour.currentTour;
if (tourObject && tourObject._options.steps.length) {
  tourObject.start();
}
</script>

The problem is that when I click on the button, nothing happens. What's wrong with my block ?

enter image description here

enter image description here

Tags : 8 blocks


Related Questions



Create main page content block

Updated April 04, 2015 18:03 PM


Blocks is not showing up

Updated March 29, 2015 06:02 AM