Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it simpler to subclass BasicTemplate #2903

Open
philippjfr opened this issue Nov 10, 2021 · 1 comment
Open

Make it simpler to subclass BasicTemplate #2903

philippjfr opened this issue Nov 10, 2021 · 1 comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Milestone

Comments

@philippjfr
Copy link
Member

The idea of a BasicTemplate with its rendering areas like main, sidebar, header and dialog has made it very easy for users to build nicer looking apps. However in many cases a user may want to define their own template or even extend an existing template to have greater control of the look and feel of their application. Right now there are quite a few difficulties doing this which you have to hack around to even make this possible. I'll list some of these here:

  1. A subclassed template will still look in Panel's dist directory (or CDN) for the CSS and JS files declared on the template. We may have to provide a way to easily bundle these files or simply falls back to inlining them if they could/can not be bundled.
  2. The jinja2 templates are not written with extensions in mind, we should make better use of block macros to allow users to overridde just certain parts of a template without overriding the whole thing.
  3. There is currently no documentation for extending a template.

I'm sure there are many more difficulties which we should address.

@philippjfr philippjfr added the type: enhancement Minor feature or improvement to an existing feature label Nov 10, 2021
@philippjfr philippjfr added this to the v0.13.0 milestone Nov 10, 2021
@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Nov 10, 2021

My thought has been that the components of the template should be refactored into standalone components using ReactiveHTML.

I believe it's now possible and very easy to create Header, Sidebar, Footer, Maximize, ReactGrid, Golden etc. components. That would also enable them to be dynamic (I.e. you can change the sidebar components, the header components and title) etc.

We should still provide templates. But those templates are build from the above components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants