Compatibility Configuration
Unlike modules, we do not recommend adding support for MageObsidian Components to existing themes that use methodologies related to Luma or Blank. This approach is radical and completely removes support for technologies like LESS, Knockout, RequireJS, among others. Therefore, we suggest using this approach only for new themes or themes based on MageObsidian Components.
Creating a Compatible Theme
To create a theme, first follow the standard steps described in the official Magento documentation:
Creating a Theme in Magento
In summary, you need to create a structure like this:
Basic Files
Make sure to include the minimum required files to register a theme in Magento:
- registration.php
- theme.xml
Declaring Theme Inheritance
When configuring the theme.xml
file, pay attention if you want to inherit from a compatible theme. Declaring a non-compatible theme as a parent will result in inheritance being ignored during the compilation process, and the theme will not work as expected.
Configuring Theme Compatibility
To configure a theme as compatible with MageObsidian Components, follow these steps:
-
Create the Compatibility File
- File Name:
mage_obsidian_compatibility.xml
1 2 3 4 5
- File Path: Save the file in the following location: ``` app/design/frontend/Vendor/ThemeName/etc/mage_obsidian_compatibility.xml ```
-
Add the File Content
- Copy and paste the following content into the file:1 2 3 4 5 6 7 8 9
```xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:MageObsidian_ModernFrontend:etc/xsd/mage_obsidian_theme_compatibility.xsd"> <features> <compatibility>true</compatibility> </features> </config> ```
Final Steps
After configuring the compatibility file, you must run the following commands to integrate the theme into Magento and generate the necessary metadata:
-
Load the theme in Magento
-
Generate metadata for MageObsidian Components
Final Notes
With these steps, your theme will be fully integrated with MageObsidian Components. This approach ensures that the theme leverages the modern functionalities of the architecture, removing dependencies on outdated technologies and promoting a cleaner, more efficient experience.