Code

The code element allows you to add custom HTML/TWIG, CSS or Javascript code to your shopping experiences.

Feature of the Pro version

Since Shopware 6.5, code in the HTML elements has been cleaned - a so-called "sanitizer" filters most of the code content. With the code element, individual code can be placed in the shopping experiences without being cleaned up.

The code element (1) is in the list of selectable elements of the theme. Once placed, it displays demo content to describe usage. The preview of the element in the editor shows you parts of your written code (2, 3, 4) so that you can keep an overview when using several code elements.

Configuration

In the configuration of the element you will find the right field for each code, divided into a tab for HTML and Twig (1), styling in the CSS tab (2) and Javascript in the JS tab (3). This way you keep the full overview.

Remove the example code from all tabs.

Last updated