Multipage WizardPlugin Mixin?

I'm hoping to add a setup wizard to a plugin. Based on the documentation here I was able to get my template to show up very easily. However, I don't see any way to add a second/third (etc) page to the wizard. It would be possible for me to create the wizard in a single page, but that would not be ideal.

Also, is there an easy way to open the wizard pages on demand, or better yet to define multiple wizards where each can be opened on demand? It would be nice if I could add some additional setup wizards (like create a new printer profile) using the same kind of interface. If not I could definitely recreate a wizard style popup myself, but if I don't have to I'd rather not do that unless I have to.


You should be able to just define multiple wizard templates which will then translate into multiple pages. However, something like "on demand opening" isn't supported I fear, so for your own wizard style custom dialogs you'll have to recreate the look and feel I fear. Take a look into templates/dialogs/wizard.jinja2 and js/app/viewmodels/wizard.js for how things go together.

Will look into wizard.jinja2 and wizard.js, thanks! Regarding defining multiple templates, how would they be named so that they are picked up? Right now I have octolapse_wizard.jinja2 defined. Is there a specific naming convention for the rest of the tabs, or do I have to report them to Octoprint somehow?


You can manually define them in get_template_configs and set the names yourself. See here. The default template file name stuff is just a shortcut for the most common use case, but nothing keeps you from defining multiple templates of the same type and different template files. There's also an example for that in the suffix explanation and in the accompanying note. If you go that route though, keep the sorting in mind and name your pages accordingly.

1 Like