From beefa6daa798f2ccc79d6a7e522238e14ee06895 Mon Sep 17 00:00:00 2001 From: OpenClaw Assistant Date: Thu, 5 Feb 2026 16:41:38 +0100 Subject: [PATCH 1/2] fix: add missing .value to fullWidth config access in cms-block-blog-detail.html.twig Fixes issue #46 - Missing attribute name value in cms-blo-detail.html.twig The frontend template was accessing element.config.fullWidth directly, but Shopware CMS elements store config values in a nested 'value' property. Changed from: {% if element.config.fullWidth %} to: {% if element.config.fullWidth.value %} --- .../views/storefront/block/cms-block-blog-detail.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/views/storefront/block/cms-block-blog-detail.html.twig b/src/Resources/views/storefront/block/cms-block-blog-detail.html.twig index 1e25c7af..04fe9c2a 100644 --- a/src/Resources/views/storefront/block/cms-block-blog-detail.html.twig +++ b/src/Resources/views/storefront/block/cms-block-blog-detail.html.twig @@ -1,7 +1,7 @@ {% block block_werkl_blog_detail %} {% set element = block.slots.getSlot('blogDetail') %} -
+
{% sw_include '@Storefront/storefront/element/cms-element-' ~ element.type ~ '.html.twig' ignore missing %}
{% endblock %} From d27c82a7e564bcf7b25a91a365daea396087c08e Mon Sep 17 00:00:00 2001 From: OpenClaw Assistant Date: Thu, 5 Feb 2026 17:04:59 +0100 Subject: [PATCH 2/2] fix: implement onGetTreeItems for subcategory loading in blog category tree Fixes issue #56 - Can't assign subcategories to blog entry The werkl-blog-category-tree component was missing the onGetTreeItems method required by sw-tree to dynamically load nested categories. This caused subcategories to not appear when expanding parent nodes. Added: - onGetTreeItems() method that fetches categories from werkl_blog_category repository - Supports filtering by parentId for hierarchical category loading - Returns null on error with console logging --- .../component/blog-category-tree/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Resources/app/administration/src/module/blog-module/component/blog-category-tree/index.js b/src/Resources/app/administration/src/module/blog-module/component/blog-category-tree/index.js index b6c5954e..e9a5697a 100755 --- a/src/Resources/app/administration/src/module/blog-module/component/blog-category-tree/index.js +++ b/src/Resources/app/administration/src/module/blog-module/component/blog-category-tree/index.js @@ -9,6 +9,7 @@ export default { return { blogCategory: null, translationContext: 'werkl-blog-category', + categories: [], }; }, @@ -28,5 +29,22 @@ export default { }, syncProducts() {}, + + async onGetTreeItems({ parentId }) { + const criteria = new Shopware.Data.Criteria(1, 500); + + // Filter by parent ID if provided (for nested categories) + // If no parentId, get root categories + if (parentId) { + criteria.addFilter(Shopware.Data.Criteria.equals('parentId', parentId)); + } + + try { + return await this.categoryRepository.search(criteria, Shopware.Context.api); + } catch (error) { + console.error('Failed to load blog categories:', error); + return null; + } + }, }, };