- Issue created by @mlncn
- 🇪🇸Spain psf_ Huelva
Hi @mlncn,
Thank you for your suggestion and for contributing to the module discussion!
After reviewing your request, I believe that the functionality you're looking for—applying the admin theme based on content type rather than strictly by route—is not directly related to this module. The reason is that Drupal’s routing system does not differentiate between bundles when determining which theme to apply, especially for creation forms (/node/add/{content_type}).
A more effective approach would be to handle this via a separate module that implements a Theme Negotiator, which can check the content type dynamically and apply the appropriate theme accordingly.
If the Admin Theme → module does not fully cover your needs, I’d be happy to help guide or assist in developing a new module specifically for this feature. Let me know if you're interested in collaborating on this!
Thanks again for your input!
Best
- 🇺🇸United States mlncn Minneapolis, MN, USA
Thank you so much for your quick and kind response!
Admin Theme has the same
I am curious why Simple Admin Theme by Route uses event subscriber when alterRoutes should be enough to add
_admin_route
And do you know for certain that your EventSubscriberInterface onKernelRequest() cannot set the theme for non-route things like path for the creation forms and what type of object (or rather bundle of entity) for edit forms? Since i'll have to grab the request anyway your approach seems a little more straightforward than the ThemeNegotiator approaches i'm finding.
Thank you very much for everything!
(New module coming shortly…)
- 🇺🇸United States mlncn Minneapolis, MN, USA
And the module is done!
Administration Theme by Content Type - https://www.drupal.org/project/admin_theme_by_content_type →
I think you are right it is more straightforward for the end-user as a standalone. Thanks!
- 🇪🇸Spain psf_ Huelva
Hi,
Nice project :D I added the "similar projects" section with your module too : )))