Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net
The plugin ships three template overrides that apply the mmd_snippets filter. Under Shopware 6.7 two of them are effective. No template changes of your own are needed.
| Location | Template | Block | Output |
|---|---|---|---|
| Description in the CMS product layout ("Product description" element of the default product layout) | storefront/component/product/description.html.twig |
component_product_description_content_text |
HTML, snippet contents sanitized |
| Product cards (listings, search, CMS product sliders and listings) | storefront/component/product/card/box-standard.html.twig |
component_product_box_description |
Text only, all HTML is stripped |
| Product detail page, legacy template | storefront/page/product-detail/description.html.twig |
page_product_detail_description_content_text |
Inactive under Shopware 6.7 |
The third template has no effect under Shopware 6.7: the Shopware core no longer has a template with this path in 6.7, it has been marked deprecated since 6.6 and is no longer loaded by default. This finding about the Shopware core comes from the source code of Shopware 6.6 and 6.7. The plugin line for Shopware 6.5/6.6 ships the same template; whether the core loads it there has not been checked here.
The replacement only applies where the filter is applied: in the product description of the CMS product layout and on product cards. It does not apply in CMS text elements, in category descriptions, in custom fields or in any other output, unless you apply the filter there yourself.
|mmd_snippetsReplaces all placeholders in a string and returns HTML that is not escaped again:
{{ product.translated.description|mmd_snippets }}
A |raw is not needed. If the value passed in is empty, the result is an empty string.
mmd_snippet('identifier')Returns the content of one active snippet in the current language, or an empty string if the snippet does not exist or is inactive:
{{ mmd_snippet('warranty-info') }}
The function only works in Twig templates, not in stored content such as product descriptions. Use the placeholder syntax there. Unlike the filter, the function does not sanitize the content, it outputs it as stored. Therefore, only let admin users you trust maintain snippets.
If your theme overrides one of the blocks above itself, the plugin no longer replaces anything there, because the plugin template no longer produces the output. In that case apply the filter in your override:
{% sw_extends '@Storefront/storefront/component/product/description.html.twig' %}
{% block component_product_description_content_text %}
<div class="product-detail-description-text" itemprop="description">
{{ product.translated.description|mmd_snippets }}
</div>
{% endblock %}
For other content areas, apply the filter to the respective value in your own template.