How is category description rendered in Shopware 6 storefront

375 Views Asked by At

This question might seem vague but I know how to work with TWIG. At the moment, I am trying to extend the Category pages and specifically Category description section in Shopware 6 storefront. But I can not find the Category Description block.

I was able to trace a block to the Category at storefront/page/content/index.html.twig

           {% block cms_content %}
                <div class="cms-page">
                    {% block page_content_blocks %}
                        {% sw_include "@Storefront/storefront/page/content/detail.html.twig" with {'cmsPage': page.cmsPage} %}
                    {% endblock %}
                </div>
            {% endblock %}

Category Description (circled in red)

2

There are 2 best solutions below

2
dneustadt On

You may want to check the type of the CMS page.

{% block page_content_blocks %}
    {% if page.cmsPage.type == 'product_list' %}
        Change the world...
    {% else %}
        {{ parent() }}
    {% endif %}
{% endblock %}
0
CodeEditor712 On

The contents of the page you are editing are shopping experience elements.

Showing the category description is standard functionality in the shopping experiences module! Just duplicate the standard, add a text field and map it to the category description.

If you to edit it to your wishes, I recommend making a custom shopping experience element. You can find the documentation of this here:

https://developer.shopware.com/docs/concepts/commerce/content/shopping-experiences-cms