The Magento2 Blog module integrates a dynamic blog system into your Magento 2 store. It is built using a Headless CMS (DatoCMS) and leverages GraphQL for efficient data retrieval. Blog articles, categories, and featured images are fetched from DatoCMS using GraphQL queries calls, allowing you to manage content externally while seamlessly presenting it within your Magento storefront.
- Display latest blog posts on your Magento frontend
- Filter blog posts by category
- Fetch and display feature images for articles
- SEO-friendly blog URLs and meta information
- Category listing and navigation
- Product carousel integration for related products
- Easy configuration via Magento admin
- Built with Headless CMS (DatoCMS) for flexible content management
- Uses GraphQL for fast and flexible data queries
- Copy the module files into
app/code/Studio3Marketing/Magento2Blog(or your custom path). - Run the following Magento CLI commands:
php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento cache:flush
- Ensure the module is enabled:
php bin/magento module:status Studio3Marketing_Magento2Blog
- Log in to the Magento Admin Panel.
- Go to Stores > Configuration > Magento2 Blog > General.
- Set the following options:
- API Key: Your DatoCMS API key
- API URL: (Optional) Override the default API endpoint
- Posts Per Page Limit: Number of posts to show per page
- Save the configuration and clear the cache if needed.
- The blog will be accessible at
/blogon your storefront. - Article detail pages are available at
/blog/article/view?id=ARTICLE_IDor SEO-friendly URLs if configured. - Categories and navigation are automatically generated from your DatoCMS content.
- To customize templates, edit the
.phtmlfiles inview/frontend/templates/. - Product carousels for related products can be managed via the
ProductCarouselViewModel.
Block/- Magento blocks for fetching and preparing blog dataController/- Controllers for blog, article, and category routesHelper/- Helper functions for category and debug utilitiesModel/ApiClient.php- Handles API requests to DatoCMS using GraphQLViewModel/- ViewModels for advanced frontend features (e.g., product carousel)view/frontend/- Layout XML, templates, CSS, and JS for the frontendetc/- Module configuration files
- Update layout or templates in
view/frontend/as needed - Extend blocks or controllers for additional features
- Use the helper and ViewModel classes for custom logic
For issues or feature requests, please contact the module author or your Magento development team.
Studio3Marketing Magento2 Blog — Seamlessly integrate a headless blog into your Magento 2 store using GraphQL and DatoCMS!