voila-gridstack icon indicating copy to clipboard operation
voila-gridstack copied to clipboard

Best strategy to use a non-default template

Open fcollonval opened this issue 3 years ago • 3 comments

What is the best strategy to use a custom voila template? Is it by setting voila_configuration.allow_template_override to False and forcing the wanted template?

Comment

The behaviour of the notebook toolbar button and the editor toolbar button is slightly different (the editor set the template but not the notebook):

https://github.com/voila-dashboards/voila-gridstack/blob/0d729c9546451b44cc9ac5682f3ade0ef50d741f/packages/jupyterlab-gridstack/src/editor/components/notebookButtons.ts#L67

https://github.com/voila-dashboards/voila-gridstack/blob/0d729c9546451b44cc9ac5682f3ade0ef50d741f/packages/jupyterlab-gridstack/src/editor/toolbar/voila.tsx#L19-L21

fcollonval avatar Mar 23 '21 16:03 fcollonval

We need to remove the one from the notebook since voila-preview also adds this button (there is an issue #84). Maybe we can change the icon and use this button to open voila with a gridstack template like the one on the editor's toolbar.

hbcarlos avatar Mar 24 '21 13:03 hbcarlos

What is the best strategy to use a custom voila template? Is it by setting voila_configuration.allow_template_override to False and forcing the wanted template?

We can open voila with a specific template by adding ?voila-template=gridstack at the url.

hbcarlos avatar Mar 24 '21 13:03 hbcarlos

Sorry the question was lacking clarity. In my company, we need to add branding to the template (like so many others). So forcing default gridstack template is not acceptable. For now the configuration is done on the server side to force the company's template.

fcollonval avatar Mar 24 '21 14:03 fcollonval