Site builders are able now to configure view page displays to use the admin theme, regardless of the selected path. Previously, custom code was required to display a view page display with the admin theme that was not using a /admin/ path.
Before
In order to show a view page on an arbitrary route, /some/arbitrary/route, with the admin theme, a developer should have implemented a route alter subscriber and should have set the option _admin_route to TRUE for that route.
After
In the View UI, on a page display, at Page settings there's a new option Administration theme. Clicking on the link, a modal dialog pops-up, which exposes a checkbox, Use the administration theme, that site builders are able to check. See the attached screenshot.
Page setting UI

View theme popup

Override Page setting UI

Override View theme popup

Notes
- A user should be granted with the
view the administration themepermission in order to view a page with the admin theme. - When 'Administration theme' is 'No' contrib or custom modules may alter the route thus enforcing the page to use the admin theme.
| Attachment | Size |
|---|---|
| PageSetting.png | 16.2 KB |
Comments
Will this work in Drupal 9?
Will this work in Drupal 9?