-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow use other layout like AdminLTE 3 #6388
Comments
We start working on improve assets system in SonataAdminBundle - #7034 (comment). Add support for AdminLTE 3 is one of the steps. I made some review and found:
IMO we should consider to move this feature to the WDYT? @sonata-project/contributors |
See #7049 (comment) IMHO the stable 4.0 should be release soon. Starting a new big work is not a good idea IMHO. The next major release will be made more often, so we don't have to hurry now to take as much feature as possible for the 4.0. |
👍 I'm not sure if we can find a way to provide support for two different themes, because we use a lot of template overrides and twig blocks. Supporting two major html frameworks requires a lot of work and maintenance. |
It is simple to do. We should copy all current templates to the {% include '@SotataAdmin/'~global_admin_layout_parameter~'/layout.html.twig' %} It can be also easy extends by users. |
The copy & paste stuff from the main template should be easy, but we must provide for all child template (e.g. blocks). They must work with admin lte 2 (bootstrap 3) and admin lte 3 (bootstrap 4). It looks very difficult to me, but feel free to provide a PR. Keep in mind that the template rendering time might explode with too many if/else statements on the child templates. |
IMHO having to maintain this double template files is a huge maintenance source of problems. And opens a world of having more different layouts requested. If @sonata-project/contributors feel like this is the way to go, please open, I will close it for now, since the original pr is also closed. |
I agree |
The best way of supporting this type of feature request would be to convert Sonata to essentially provide its own REST API and to use that API across the board with the frontend template, which would be a pretty big change that would (more or less) deprecate Twig templating in favor of Vue, Angular, React, etc. The default template could favor a specific JS framework and provide a reference implementation, and additional frontends could be developed, plus the REST API could be usable in other contexts, potentially. But at that point it's a pretty major rewrite.... maybe for Sonata 6? :) |
For now we use AdminLTE2 based on bootstrap 3. After add
webpack
tools to create new custom layout we should add new options for AdminBundle too. My idea is add options:Information about layout will be add to TemplateRegistry. New files for supported layouts will be add in
Resources/views/layouts
.TODO
createcopy admin_lte3 files toResources/views/layouts/admin_lte3
The text was updated successfully, but these errors were encountered: