Knowledge Hub

Magento 2 Tutorials & Hyvä Guides

Practical, tested-in-the-field articles from our Magento engineers: module development, Hyvä themes, Magento 2.4.9 upgrades, performance and technical SEO. Code follows current Magento and Hyvä standards.

All Tutorials Hyvä Theme Magento 2 Performance Magento SEO
📖
Featured Post
Tutorials Oct 9, 2026 · 4 min read

Magento 2 Content Security Policy: csp_whitelist.xml and PCI DSS 4.0

Fix Magento 2 Content Security Policy violations with csp_whitelist.xml, understand report-only vs restrict mode on checkout in 2.4.7+, SRI hashes, inline scripts with $secureRenderer and Hyvä CSP.

Read article
📚
Tutorials 4m

Magento 2 Plugins: before, after and around Methods With Examples

How Magento 2 plugins work, with working before, after and around plugin examples, di.xml configuration, sortOrder rules...

Oct 9, 2026 Read →
📚
Tutorials 4m

How to Create a Product Attribute Programmatically in Magento 2

Create text and dropdown product attributes in Magento 2 with a data patch. Covers EavSetup options, attribute sets and ...

Oct 9, 2026 Read →
📚
Tutorials 4m

How to Create a Custom GraphQL Query and Resolver in Magento 2

Add a custom GraphQL query to Magento 2: schema.graphqls, a resolver class, pagination arguments, input validation and f...

Oct 9, 2026 Read →
📚
Tutorials 5m

How to Create a Custom REST API Endpoint in Magento 2

Create a custom REST API in Magento 2 with service contracts, data interfaces, webapi.xml routes, ACL resources and toke...

Oct 9, 2026 Read →
📚
Tutorials 4m

Magento 2 Declarative Schema: Creating Tables With db_schema.xml

Create and change database tables in Magento 2 with db_schema.xml. Columns, indexes, foreign keys, whitelist generation,...

Oct 9, 2026 Read →
📚
Tutorials 4m

How to Create an Admin Grid With UI Components in Magento 2

Build a Magento 2 admin grid with UI components: menu, admin route and controller, layout, listing XML, data provider vi...

Oct 9, 2026 Read →
📚
Tutorials 3m

Magento 2 ViewModels and $escaper: Writing Templates the Right Way

Write secure, maintainable Magento 2 templates with ViewModels and $escaper. When to use escapeHtml, escapeHtmlAttr, esc...

Oct 9, 2026 Read →
📚
Tutorials 3m

Magento 2 Events and Observers Explained

Listen to Magento 2 events with observers: events.xml, ObserverInterface, area-specific events, dispatching custom event...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Create a Custom CLI Command in Magento 2

Build a custom bin/magento command in Magento 2 with Symfony Console: arguments, options, table output, proxies, area em...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Create a Cron Job in Magento 2

Create a custom cron job in Magento 2 with crontab.xml, configurable schedules, custom cron groups, and learn how to ins...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Add Admin Configuration Fields in Magento 2 With system.xml

Add store configuration fields in Magento 2 with system.xml: sections, groups, fields, source models, encrypted API keys...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Send a Custom Email Programmatically in Magento 2

Send custom transactional emails in Magento 2 with email_templates.xml, an HTML template, TransportBuilder, inline trans...

Oct 9, 2026 Read →
📚
Tutorials 4m

How to Create a Customer Attribute Programmatically in Magento 2

Add a custom customer attribute in Magento 2 with a data patch, show it in the admin customer grid and form, and on the ...

Oct 9, 2026 Read →
📚
Tutorials 5m

How to Create a Custom Module in Magento 2

Create a custom Magento 2 module from scratch: registration.php, module.xml, composer.json, enabling the module, and a w...

Oct 9, 2026 Read →
📚
Tutorials 4m

How to Create a Controller in Magento 2

Create frontend and admin controllers in Magento 2.4.9 with HttpGetActionInterface and HttpPostActionInterface. Includes...

Oct 9, 2026 Read →
📚
Tutorials 4m

How to Set Up Multiple Websites, Stores and Store Views in Magento 2

Set up a Magento 2 multi-store: websites vs stores vs store views, creating them in the admin or CLI, Nginx routing with...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Install Magento 2.4.9 on Localhost With Docker

Install Magento 2.4.9 locally with Docker using DDEV or Warden: PHP 8.4, OpenSearch, MariaDB, Redis/Valkey and sample da...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Add a Slider to Magento 2 (Luma and Hyvä)

Add a product or banner slider in Magento 2: Slick Carousel with RequireJS on Luma, and a lightweight, accessible Alpine...

Oct 9, 2026 Read →
📚
Tutorials 3m

How to Create a Custom Admin Theme in Magento 2

Create a custom Magento 2 admin theme: registration, theme.xml with Magento/backend as parent, LESS overrides, applying ...

Oct 9, 2026 Read →

Need Expert Magento Help?

Our Magento 2 and Hyvä specialists are ready to help with your project.

Free SEO & eCommerce Tools — No Signup Required

Check on-page SEO, generate schema markup and estimate what a faster store is worth. Instant results, no registration.