I have found an issue,
If I add new group, and add group members or node to this group, as you can see on screenshot one time i have administration theme(Seven), but if I go to members tab or nodes i got loaded another theme. Testing as a admin.
I see that this two tabs(nodes and members) are in Views with paths /group/%group/nodes and /group/%group/members, so is there any quick fix to use only one theme in whole group?
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 2784735-group_unified-layout-admin-theme-14.patch | 422 bytes | firewaller |
| Zrzut ekranu 2016-08-16 o 11.23.26.png | 111.59 KB | Sebulec | |
| Zrzut ekranu 2016-08-16 o 11.23.34.png | 259.44 KB | Sebulec |
Comments
Comment #2
Sebulec commentedComment #3
kristiaanvandeneyndeGood catch, it's because they are views. Let's see if we can fix that :)
Comment #4
kristiaanvandeneyndeI would argue that this needs to be added to core. If we have a simple UI toggle to say "admin route", then we don't need to guess what views people will be creating with Group.
Comment #5
sutharsan commentedI have no time to work in this now, but I do have some ideas which may help someone else.
The Members page is indeed a view. I agree with kristiaanvandeneynde that a setting in the view would be the best interface. To get a page to use the admin theme, the '_admin_route' option must be added to the route. The Views PathPluginBase::getRouteName() provides the route name of a view.
Comment #6
decipheredI implemented a custom routing alter in my project to deal with this for myself. Find the code below for anyone who wishes to do so (note, this is just for the Nodes section at the moment):
YOUR_PROJECT/src/Routing/RouteSubsciber.php
YOUR_PROJECT/YOUR_PROJECT.services.yml
Note: Code was edited here to remove identifiable project names and such, so hopefully no mistakes introduced.
Comment #7
markconroy commentedHi Guys,Can I piggyback on this issue to suggest that whatever theme is set as the admin theme should also be used when creating content inside a group?At the moment, I have a role called 'Content Editor'. That content editor has permission 'View the administration theme'. However, when creating content inside a group, they are presented with the default theme. I guess this is because the path is group/%id/node/create/foo rather than node/add/fooSorry - my mistake, I hadn't added the correct user to my 'Content Editor' role.
Comment #8
kristiaanvandeneyndeHey Deciphered, that's a correct approach you're listing there but it requires hard-coding the list of routes. I would prefer if core had a toggle in the Advanced section of a view saying "Use the admin theme" and then have a route subscribed pick that up.
Comment #9
kristiaanvandeneyndeActually, see #2719797: New option for Views page displays to use the admin theme
Comment #10
deciphered@kristiaanvandeneynde
I agree entirely, but I had need for the functionality now so I took my own path, the code is just for anyone else who also wishes to implement it now.
Thank you for the link, good to see there is progress being made on the real core issue.
Comment #11
tsi commentedHi @Deciphered
You're missing few
Rs in your comment. ctrl+fRouteSubsciber.Comment #12
vbouchetMy current workaround until the core issue is fixed is to use admin_theme.
Comment #13
camslice commentedLatest patch from #2719797: New option for Views page displays to use the admin theme works well
Comment #14
firewaller commentedNew option for Views page displays to use the admin theme was merged to 10.1.x back in 2023.
I've added the config change to the module view against 3.3.x
Please note, if you've already exported the config locally you may need to make the same change to you config manually.