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

Allow use other layout like AdminLTE 3 #6388

Closed
4 tasks
wbloszyk opened this issue Sep 14, 2020 · 8 comments
Closed
4 tasks

Allow use other layout like AdminLTE 3 #6388

wbloszyk opened this issue Sep 14, 2020 · 8 comments
Labels
Milestone

Comments

@wbloszyk
Copy link
Member

wbloszyk commented Sep 14, 2020

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:

sonata_admin:
    layout: admin_lte2 # admin_lte2 or admin_lte3
    custom_layouts:
        my_custom_layout: dir_to_files

Information about layout will be add to TemplateRegistry. New files for supported layouts will be add in Resources/views/layouts.

TODO

  • add new options
  • implements layout option in TemplateRegistry
  • create copy admin_lte3 files to Resources/views/layouts/admin_lte3
  • add documentation about experimental feature (this change can be done in 3.x branch)
@wbloszyk wbloszyk added this to the 5.0 milestone Oct 21, 2020
@wbloszyk
Copy link
Member Author

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 4.0 milestone. It will allow use AdminLTE 2 for legacy projects which want upgrade AdminBundle without upgrade bootstrap and allow us to add AdminLTE v4 without BC-break.

WDYT? @sonata-project/contributors

@VincentLanglet
Copy link
Member

See #7049 (comment)

IMHO the stable 4.0 should be release soon. Starting a new big work is not a good idea IMHO.
Plus, using AdminLTE 3 instead of 2 will lead to a lot of BC-break, I think we have enough BC-break for 4.0.

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.

@core23
Copy link
Member

core23 commented Apr 13, 2021

IMHO the stable 4.0 should be release soon. Starting a new big work is not a good idea IMHO.
Plus, using AdminLTE 3 instead of 2 will lead to a lot of BC-break, I think we have enough BC-break for 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.

@wbloszyk
Copy link
Member Author

IMHO the stable 4.0 should be release soon. Starting a new big work is not a good idea IMHO.
Plus, using AdminLTE 3 instead of 2 will lead to a lot of BC-break, I think we have enough BC-break for 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 views/adminLTE2. In @SonataAdmin/layout.html.twig we should keep:

{% include '@SotataAdmin/'~global_admin_layout_parameter~'/layout.html.twig' %}

It can be also easy extends by users.

@core23
Copy link
Member

core23 commented Apr 14, 2021

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.

@jordisala1991
Copy link
Member

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.

@VincentLanglet
Copy link
Member

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

@djpretzel
Copy link

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? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants