yireo / magento2-theme-by-route
Assign a specific theme to specific routes
Fund package maintenance!
yireo
www.paypal.me/yireo
Installs: 174
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 1
Type:magento2-module
pkg:composer/yireo/magento2-theme-by-route
Requires
- ext-pcre: *
- magento/framework: ^103.0
- magento/module-store: ^101.1
- magento/module-theme: ^101.1
- psr/log: ^1.0 || ^2.0 || ^3.0
README
Magento 2 module to allow a file app/etc/theme-by-route.json to determine which theme needs to be loaded for which route.
Installation
composer require yireo/magento2-theme-by-route bin/magento module:enable Yireo_ThemeByRoute
Configuration
Create 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"
]
}
]