Search by

bluefairy / module-recipes-hyva

bluefairydevelopment

Magento 2 Recipe Management Extension — Hyva Frontend

Package info

github.com/bluefairydevelopment/module-recipes-hyva

Language:HTML

Type:magento2-module

pkg:composer/bluefairy/module-recipes-hyva

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.4.0 2026-11-27 14:45 UTC

This package is auto-updated.

Last update: 2026-11-30 00:10:43 UTC


README

Free and open source (MIT). The Hyvä theme companion for the paid bluefairy/module-recipes extension. Published on packagist.org; the core module is sold separately.

Hyvä theme companion for BlueFairy_Recipes. Replaces all Luma frontend templates with Tailwind CSS and Alpine.js equivalents, gives the recipe listing a server-rendered filter and search form (submitting it reloads the page with the results), and registers Hyvä-native layout handles.

This package is MIT-licensed and free. It is not part of the core extension's licence agreement, and no licence key or purchase covers it. The core module it extends, bluefairy/module-recipes, is sold separately.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.8 or 2.4.9 (magento/framework ~103.0.8). The constraint refuses 2.4.7 and earlier and any 103.1 framework.
  • PHP 8.3, 8.4 or 8.5 (composer.json admits ~8.3.0||~8.4.0||~8.5.0).
  • Hyvä Theme (hyva-themes/magento2-theme-module ^1.0)
  • BlueFairy_Recipes ^1.3 (the core module, installed first)

Installation

# 1. This companion is free and public - no credentials needed
composer require bluefairy/module-recipes-hyva

# The core module, bluefairy/module-recipes, is a paid extension. Install it from
# wherever you bought it: your Private Packagist repository, or the Adobe Commerce
# Marketplace with your Marketplace access keys. This package requires it (^1.3)
# and composer will tell you if it is not reachable.

# 2. Enable both modules (on a Luma storefront, enable BlueFairy_Recipes alone and do not install this package)
php bin/magento module:enable BlueFairy_Recipes BlueFairy_RecipesHyva

# 3. Upgrade, compile, deploy
php bin/magento setup:upgrade
php -d memory_limit=2G bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

What It Does

The module registers a TemplateResolver plugin that intercepts getTemplate() calls on any Recipes block. When a Hyvä theme is active, the plugin swaps each Luma template for its Hyvä equivalent — no layout XML changes required on the storefront side.

Templates replaced (14 total)

Luma template Hyvä equivalent (full identifier)
product/recipes-tab.phtml BlueFairy_RecipesHyva::product/recipes-tab.phtml
recipe/affiliate-drawer.phtml BlueFairy_RecipesHyva::recipe/affiliate-drawer.phtml
recipe/ingredients.phtml BlueFairy_RecipesHyva::recipe/ingredients.phtml
recipe/list.phtml BlueFairy_RecipesHyva::recipe/list.phtml
recipe/nutrition.phtml BlueFairy_RecipesHyva::recipe/nutrition.phtml
recipe/reviews.phtml BlueFairy_RecipesHyva::recipe/reviews.phtml
recipe/schema.phtml BlueFairy_RecipesHyva::recipe/schema.phtml
recipe/share.phtml BlueFairy_RecipesHyva::recipe/share.phtml
recipe/steps.phtml BlueFairy_RecipesHyva::recipe/steps.phtml
recipe/submit.phtml BlueFairy_RecipesHyva::recipe/submit.phtml
recipe/view.phtml BlueFairy_RecipesHyva::recipe/view.phtml
widget/featured.phtml BlueFairy_RecipesHyva::widget/featured.phtml
writer/list.phtml BlueFairy_RecipesHyva::writer/list.phtml
writer/profile.phtml BlueFairy_RecipesHyva::writer/profile.phtml

Layout handles added

  • hyva_blue_recipe_index_index — recipe listing
  • hyva_blue_recipe_index_view — recipe detail
  • hyva_blue_recipe_index_submit — submission form

Storefront behaviour

  • Recipe listing — the filters and the keyword search are a plain GET form. Press Search or Apply, or Enter in the search box, and the page reloads with the results. The chosen option carries selected and the search box carries the keyword, both rendered by the server, so the controls always state the page you are actually on. There is no JavaScript in this template at all.
  • Add to Cart — reactive button state (loading spinner → success tick) on ingredient cart submission
  • Write a review — a real <form method="post"> carrying the form key. Alpine submits it in the background and shows a thank-you panel; where Alpine is unavailable the same form posts normally and the page comes back with a message. The rating is five native radio buttons, so it is one tab stop with arrow-key selection and it submits without JavaScript.
  • Submit a recipe — the ingredient and step rows are added by Alpine. The two hidden JSON fields carry value="[]" from the server, so a form submitted before Alpine has run posts an empty list rather than an empty string.
  • Affiliate drawer — off-canvas drawer, role="dialog" with aria-modal="true". It moves focus to its close button when opened, keeps Tab inside the panel, marks the rest of the page inert while it is open, closes on the Escape key and on a click on the backdrop, and returns focus to the control that opened it.

Content Security Policy

Hyvä switches Alpine to its CSP build on its own whenever your script-src policy forbids unsafe-eval, and that build resolves property and method names only — a call, an operator, a ternary or a bracket index in a directive resolves to nothing and the control silently does not run. So, in this package:

  • every inline <script> is registered with Hyvä's CSP helper ($hyvaCsp->registerInlineScript()), which adds its hash or a nonce to the header;
  • every Alpine component is registered with Alpine.data() and referenced by a bare name, with no expression in any directive — named getters and methods instead;
  • no template uses x-model, which the CSP build cannot write back through;
  • every control that matters is server-rendered markup, enhanced by Alpine rather than created by it.

The intent is that these templates behave the same on a store with CSP enforced and on one without. If you run CSP, the storefront policies live under Stores → Configuration → Security → Content Security Policy.

Tailwind CSS Source Scanning

The Hyvä templates use Tailwind utility classes, and the theme build has to scan them. This package registers its own Tailwind source with Hyvä's configuration generator (it listens to the hyva_config_generate_before event, Observer/RegisterModuleForHyvaConfig.php), so a standard Hyvä theme needs no manual @source lines. After installing or upgrading the package, run:

php bin/magento hyva:config:generate
cd app/design/frontend/<Vendor>/<theme>/web/tailwind
npm ci && npm run build
php bin/magento cache:flush

If your theme build does not use the generated configuration, add the following @source directives to your child theme's Tailwind entry point instead. Adjust the relative path to match your theme's directory depth.

/* BlueFairy Recipes — Hyvä templates */
@source "../../../../../../../vendor/bluefairy/module-recipes-hyva/view/frontend/**/*.phtml";
@source "../../../../../../../vendor/bluefairy/module-recipes-hyva/view/frontend/**/*.xml";

After adding them, rebuild your theme CSS and flush the cache:

cd app/design/frontend/<Vendor>/<theme>/web/tailwind
npm run build
php bin/magento cache:flush

Troubleshooting

Hyvä templates not loading

  • Confirm the module is enabled: php bin/magento module:status BlueFairy_RecipesHyva
  • Run php bin/magento setup:di:compile && php bin/magento cache:flush
  • Confirm your active theme extends the Hyvä base theme

The filters do not apply

  • The listing toolbar is a form: choose your filters and press Apply or Search. It does not submit on its own, by design — a page that reloads mid-word throws focus to the top of the document (WCAG 2.2 3.2.2 On Input)
  • Confirm BlueFairy_RecipesHyva is enabled (not just BlueFairy_Recipes)

A button or drawer does nothing, and the console says "Alpine is unable to interpret the following expression"

  • That is the Alpine CSP build refusing a directive. Nothing in this package's own templates should produce it — if one does, please report it with the expression from the console
  • Check the same page with a child theme override removed: an override written for the plain Alpine build will fail this way under CSP

Tailwind utility classes missing (unstyled output)

  • Run php bin/magento hyva:config:generate, confirm app/etc/hyva-themes.json has an entry whose src is vendor/bluefairy/module-recipes-hyva, and rebuild the theme CSS
  • If your build does not use the generated configuration, add the @source directives above

Full Documentation

See the core extension's own README, shipped in bluefairy/module-recipes, for full configuration, admin usage, ACL roles and troubleshooting.