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

1.1.1 2025-10-22 11:15 UTC

This package is auto-updated.

Last update: 2025-10-22 14:11:59 UTC


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"
    ]
  }
]