Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
AFAICT, there's no D8 equivalent of the 'theme callback' property of hook_menu() items on D7.
But... there is, it's CustomThemeNegotiator. But it's in a test module, theme_test.
It provides a '_custom_theme' property to routes, which lets you specify the theme:
theme_test.function_template_override:
path: '/theme-test/function-template-overridden'
options:
_custom_theme: 'test_theme'
defaults:
_controller: '\Drupal\theme_test\ThemeTestController::functionTemplateOverridden'
requirements:
_access: 'TRUE'
It would be useful to move this into system module, so it can be used.
Comments
Comment #2
dawehnerWell, the equivalent is to write your own theme negotiator ...