Installing Hyvä CMS
Prerequisites
See Hyvä Commerce Prerequisites.
Installation
Installation via Hyvä Commerce Metapackage Recommended
The below steps are for installing Hyvä CMS only. While this is supported to provide greater flexibility and control over installed features, in most cases, we recommend installing all Hyvä Commerce features using our metapackage.
With a License Key
-
Require the
hyva-themes/commerce-module-cms
package -
Run
bin/magento setup:upgrade
-
Run tailwind to generate storefront styles, replacing
vendor/hyva-themes/magento2-default-theme/web/tailwind/
with the path to your theme'sweb/tailwind
folder:
For Agency and Technology Partners
If you have access to the Hyvä Commerce GitLab repositories as Gold/Platinum Agency Partner, or a Technology Partner, you can install Hyvä Commerce in development environments using SSH key authentication.
You can configure the git repositories in your root composer.json and use the repositories directly as git repo's beneath your vendor directory. You can check out tags and branches, make commits and push contributions.
This installation method is not suited for deployments, because GitLab requires SSH key authorization.
-
Ensure your public SSH key is added to your account on gitlab.hyva.io.
-
Set minimum-stability to
dev
in the Magento composer.json -
Add the Hyvä CMS and base Hyvä Commerce module repositories to the Magento
composer.json
-
Require the
hyva-themes/commerce-module-cms
packages using thedev-main
branch version: -
Run
bin/magento setup:upgrade
-
Run tailwind to generate storefront styles, replacing
vendor/hyva-themes/magento2-default-theme/web/tailwind/
with the path to your theme'sweb/tailwind
folder:
Additional Setup
Enable 'New' Media Gallery
Hyvä CMS only supports the 'New' Media Gallery, for handling image selection and editing (using the Image Editor). Enabling the 'New' Media Gallery can be configured in the admin panel.
Multi-Store / Custom Admin Domain Setup
When using the Hyvä CMS Liveview Editor with multiple storefronts on different domains, or even in a single store scenario, when the admin domain is different from the storefront, browsers block iframes by default. Since the editor loads storefront previews inside the Magento admin, you must securely allow embedding within the admin domain for it to work properly.
To ensure proper iframe functionality across domains, configure the Content Security Policy (CSP) frame-ancestors directive to permit the admin domain.
-
Enable CSP Restrict Mode in the admin area. Add or update the following configuration in
config.xml
(or toapp/etc/env.php
): -
Add or update the CSP Whitelist Rules In a
csp_whitelist.xml
file add the following:<?xml version="1.0"?> <csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd"> <policies> <policy id="frame-ancestors"> <values> <value id="magento-admin-domain" type="host">your-admin-domain.com</value> <value id="self" type="host">self</value> <value id="https" type="host">https:</value> </values> </policy> </policies> </csp_whitelist>
Handling the Hyva_CMS Cache
The hyva_cms
cache is automatically enabled in production environments and disabled in developer mode.
This cache stores component configurations for improved performance.
Depending on your deployment strategy, you may need to include a step to clear the cache on each deployment:
Performance Optimization
JIT CSS Compilation
Hyvä CMS uses magento2-cms-tailwind-jit
module for compilation.
- CSS classes are generated on-demand based on component usage (can be changed to on save)
- Custom Tailwind configurations are supported per theme