In this tutorial, I will explain how to Integrate Luma Theme Fallback Hyvä theme for Magento 2. This feature in Hyvä allows you to route specific pages or paths to another theme. For instance, if you wish to exclude certain pages or routes from running on the Hyvä theme, you can leverage this functionality to display those pages using the Luma theme or any other configured theme.
Magento will automatically use the corresponding template or style from the Luma theme if a specific template or style is not available in the Hyvä theme. In this setup, the Luma theme serves as a fallback option.
key benefits of using the Luma theme fallback in Magento
- Seamless Compatibility:
Allows pages or features not fully supported by the Hyvä theme to function using the Luma theme, ensuring consistent performance without interruptions. - Enhanced Flexibility:
Enables you to selectively route specific pages or functionalities to the Luma theme, offering more control over the design and functionality of your website. - Faster Development:
Reduces the need to recreate templates or styles in the Hyvä theme, as Magento automatically uses existing resources from the Luma theme. - Cost-Effective Solution:
Saves time and development costs by leveraging the Luma theme for unsupported pages or functionalities instead of custom development. - Gradual Migration:
Simplifies the process of transitioning to the Hyvä theme by allowing certain parts of the website to temporarily rely on the Luma theme. - Improved Compatibility with Extensions:
It facilitates the use of third-party extensions designed for the Luma theme, eliminating the need for extensive modifications. - Enhanced User Experience:
Ensures a consistent user experience across the website, even when using a mix of Hyvä and Luma themes for different pages.
Integrate Luma theme fallback in Hyvä
We assume that you have already installed hyva theme.
Step 1: Add theme fallback module using composer as a dependency in your project.
composer require hyva-themes/magento2-theme-fallback
Step 2: Execute all the below commands to install the module and make it work.
php bin/magento s:up
php bin/magento s:s:d -f
php bin/magento c:f
Step 3: Now, apply the hyva theme in your store from admin Content -> Design -> Configuration.
After, Go to Store -> Configuration -> Hyva Themes -> Theme Fallback & Set this below value in the Configuration & save Configuration.
Enable: Set Yes into the dropdown.
Theme full path: Select the theme which you want to apply as fallback.
Apply fallback to requests containing: Add action / router path into URL field which you want to exclude and save configuration.
You may also like this:
Conclusion:
I hope this blog has clearly explained how to use the Luma theme fallback feature in the Hyvä theme for Magento 2 and how to exclude specific pages or routes from running on the Hyvä theme. If you have any questions or feel that I missed something, please leave a comment, and I’ll be happy to assist you!”