Closed WilliamHua closed 9 years ago
Would love to know this as well. I have a solution for you, if you only have one tutorial.
If you have one tutorial you can provide Sideshow.config.autoSkipIntro = true;
which will skip the Choose a Tutorial Page.
We have multiple tutorials, but want to open a specific tutorial, how can we do this?
Actually, we've got a solution when you have multiple tutorials.
You can get the available wizards through calling
Sideshow.getElegibleWizards()
. This basically returns an array of Objects/Classes.
You can then use lodash (or underscore) to find the wizard which matches a certain property. For example, to start the wizard with the the name
being watchlist
you would call:
var wizard = _.find(Sideshow.getElegibleWizards(), {name:'watchlist'})
Lastly you would want to play it, you can do this by calling prepareAndPlay()
on the wizard:
wizard.prepareAndPlay()
Putting this all together:
_.find(Sideshow.getElegibleWizards(), {name:'watchlist'}).prepareAndPlay();
If I've got the spare time I might submit a pull request, but happy for somebody else to do this if they've got a moment to spare.
TLDR _.find(Sideshow.getElegibleWizards(), {name:'watchlist'}).prepareAndPlay();
@alcidesqueiroz is awesome and has just created this feature in v0.4.2
. Update to that version and you can specify the tutorial by calling:
Sideshow.start({wizardName: "nameOfWizard"});
If this solves your issue, please remember to close this issue.
@WilliamHua I've just released a new version of Sideshow with this enhancement yesterday. Now you can start a specific wizard by passing the wizardName
option to the Sideshow.start
method. Just like this:
Sideshow.start({ wizardName: "introducing_sideshow" });
@DanielApt the problem with the approach of calling prepareAndPlay()
directly is that the hotkeys bindings (e.g., the ESC key) are not initialized. Besides, the close button isn't rendered, and the user will have to finish the tutorial in order to close it. Well, the latest release (v0.4.2-platoon
) does the job! =)
Is there a way to skip past the "choose a tutorial page' and just select a tutorial to show them?