Skip to content

redkiwi/magento2-storyblok-integration

 
 

Repository files navigation

Magento 2 Storyblok Integration

Unit Tests Coding Standards codecov License: GPL v3

Our Magento 2 integration allows developers and digital agencies to create content-rich pages that are easily editable using the Storyblok interface.

Storyblok Integration Overview

Why Storyblok?

Storyblok allows you to manage content through a CMS that is intuitive and easy to use. It offers features like:

  • Visual Editor
  • Content Types with Blocks
  • Custom Fields
  • Internationalization Support
  • Content Scheduling, and more!

It can be used as an alternative to Magento Commerce's Page Builder as it provides all of its features and, combined with our integration module, it allows for a more pleasant developer experience when it comes to creating custom blocks.

Documentation

Asset Proxy

Optional feature that routes Storyblok asset URLs (images, PDFs, videos, etc.) through Magento, enabling Varnish/page cache to serve assets from the same domain.

Configuration

  1. Navigate to Stores > Configuration > Media Lounge > Storyblok > General > Asset Proxy and set to Yes
  2. Configure Asset Hosts with your Storyblok CDN hostname(s) as a comma-separated list

Storyblok uses regional CDN domains. See Storyblok Asset Documentation for your region's hosts. The first host is used for fetching, all are matched for URL rewriting. Examples: a.storyblok.com (EU), a-us.storyblok.com (US), a-ap.storyblok.com (AU).

How It Works

When enabled, Storyblok asset URLs from configured hosts are rewritten to {base_url}/storyblok/asset/proxy/path/{encoded_path}. The proxy fetches the asset from the primary host and returns it with Cache-Control: public, max-age=31536000 headers, allowing Varnish to cache the response.

Two integration points:

  • Output plugin — Automatically rewrites all Storyblok asset URLs in Element block HTML output (images, WYSIWYG, everything)
  • ViewModel\AssetProxy — For use in custom .phtml templates outside Storyblok blocks via getProxiedUrl($url)

Cache Behavior

Proxied assets are served with a 1-year cache header. Since Storyblok asset URLs contain content hashes, they are effectively immutable — a new asset produces a new URL.

Videos

If you want to see it in action you can watch our YouTube playlist.


Do you want to work in projects like these?

At Media Lounge we're always looking for talented Magento developers, if you're interested feel free to get in touch!

Media Lounge Logo

About

Magento 2 extension to integrate Storyblok visual editor

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PHP 96.7%
  • JavaScript 2.5%
  • HTML 0.8%