Repository navigation
Quick Start
Welcome to the WindAndKite Storyblok integration for Magento 2! This guide will help you get up and running quickly, focusing on the essential steps to create and display your first Storyblok content.
If you haven't already, follow the Installation Guide to install the module in your Magento 2 project.
After installation, the first step is to connect your Magento 2 store to your Storyblok space. You'll need your Storyblok API token.
- Log in to your Magento Admin Panel.
- Navigate to Stores > Configuration > WindAndKite > Storyblok.
- Under General Settings, enter your Storyblok API Token.
- You can find your API token in your Storyblok space under Settings > Access Tokens.
- Click Save Config.
Let's create a simple block in Storyblok and see it displayed in your Magento store.
- Log in to your Storyblok space.
- Go to Content and create a new Story (e.g., a page).
- Inside your Story, click + Add block.
- Give your block a name (e.g.,
my_first_block). - Define a simple schema for it, for example, a
textfield namedtitle. - Add some content to the
titlefield (e.g., "Hello from Storyblok!"). - Save and Publish your Story.
Once you have created your Storyblok block, you will need to create a corresponding PHTML template file in your Magento 2 theme to render it. This module expects block templates to be located in [Your_Theme_Directory]/WindAndKite_Storyblok/templates/block/.
For Storyblok stories, a default template is provided for stories with the page content type. If your story uses a different content type, you will need to create a corresponding story template in [Your_Theme_Directory]/WindAndKite_Storyblok/templates/story/ that matches the story's slug.
2. Create a new file named my_first_block.phtml (matching the name of your Storyblok block) in this directory.
- Example path:
app/design/frontend/YourVendor/YourTheme/WindAndKite_Storyblok/templates/block/my_first_block.phtml
- Add the following content to
my_first_block.phtml:
<?php /** @var \WindAndKite\Storyblok\Block\Story $block */ ?>
<div>
<h1><?= $block->getTitle(); ?></h1>
</div>Now, let's see your Storyblok content live in Magento.
- Clear your Magento cache:
php bin/magento cache:clean - Access the URL of the Story you created in Storyblok (e.g., if your Storyblok story slug is
my-test-page, and your Magento base URL isyour-store.com, navigate toyour-store.com/my-test-page).
You should now see "Hello from Storyblok!" displayed on your Magento page!
This demonstrates the basic flow of creating content in Storyblok and rendering it in Magento. You can now explore more advanced features like Creating Custom Templates and Accessing Storyblok Data.
© 2025 Wind And Kite. All rights reserved.
- Website: https://www.windandkite.com/
- Email: hello@windandkite.com
These pages are published from docs/wiki. To suggest a change, open a pull request there.