Magento 2 module to allow a file app/etc/theme-by-route.json to determine which theme needs to be loaded for which route.
composer require yireo/magento2-theme-by-route
bin/magento module:enable Yireo_ThemeByRouteCreate a file app/etc/theme-by-route.json similar to the following:
{
"Loki/luma": [
"cms/index/index"
]
}Now, the Loki/luma theme is applied to all pages.
If you want to control under which circumstances which theme is applied, there is an advanced syntax as well:
[
{
"scope_type": "website",
"scope_code": "default",
"theme": "Loki/luma",
"pages": [
"cms/index/index"
]
}
]