Yireo ThemeByRoute
yireo/magento2-theme-by-route
Loads a specific theme per route based on an app/etc/theme-by-route.json file, with advanced per-website and per-store scope rules for fine-grained theme selection.
No errors foundPHPStan level 3Build passingSemVer violations (83% compliant)
- Supported Magento versions
- 2.4.9
- License
- OSL-3.0
- Categories
- Developer Tools
513 installs★ 2 stars15 downloads/monthLatest: v1.1.2Released 2025-12-01
composer require yireo/magento2-theme-by-routeREADME
Reproduced from the package’s own README, under its own license, as of 2026-10-31. Links and images point back at the source repository.
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_ThemeByRoute
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"
]
}
]Links
- Packagist
- PackageMaven (source of the quality data)
- Repository
- Issues