Navigation

ThemeWare® Knowledge Base

Designing Shopping Experiences with Bootstrap HTML code

How to insert Bootstrap elements such as buttons, alerts, badges and lists as HTML code into the text element of your Shopping Experience, with examples.

Applies to Shopware 6.7, ThemeWare® 5.6.0 · Checked on

The Shopware 6 storefront is based on the Bootstrap framework, and thanks to its HC-Architecture® ThemeWare® is fully compatible with it. You can therefore insert ready-made Bootstrap elements such as buttons or alerts as HTML code into a text element, without writing your own CSS.

Tip: You can find examples of use in our demo shops on the pages "Bootstrap examples".

Inserting HTML code

  1. In the administration, open "Content" => "Shopping Experiences" and your layout
  2. Add a block with a text element or click on an existing text element
  3. In the toolbar of the editor, switch to the HTML view via the "</>" icon
  4. Insert the HTML code
  5. Switch back to the normal view and save the layout

Important: The HTML editor of Shopware sanitises the code when saving and removes tags and attributes it does not allow. The examples on this page only use tags and attributes that are allowed in the default setting of Shopware. More information: HTML Sanitizer

Examples

Button

A link that looks like a button. With btn-primary it gets your primary colour, with btn-outline-primary only a border, and btn-lg makes it larger.

<a href="https://service.themeware.design/New-arrivals/" class="btn btn-primary">Discover new arrivals</a>
<a href="https://service.themeware.design/Sale/" class="btn btn-outline-primary btn-lg">Go to sale</a>

Alert

A box with a coloured background for notes. You get further colours with alert-success, alert-warning and alert-danger.

<div class="alert alert-info">
    <strong>Note:</strong> We ship orders placed before 2 pm on the same day.
</div>

Badge

A small label, for example next to a headline.

<h2>Winter coats <span class="badge bg-primary">New</span></h2>

List

A list with dividing lines, for example for benefits.

<ul class="list-group list-group-flush">
    <li class="list-group-item">Free shipping from 50 €</li>
    <li class="list-group-item">30-day return policy</li>
    <li class="list-group-item">Personal advice</li>
</ul>

Two columns

With the Bootstrap grid you split the content of a text element into columns. On smartphones the columns are stacked, from tablet size they are side by side.

<div class="row">
    <div class="col-md-6">
        <h3>Material</h3>
        <p>100 % organic cotton</p>
    </div>
    <div class="col-md-6">
        <h3>Care</h3>
        <p>Washable at 30 degrees</p>
    </div>
</div>

Which Bootstrap version?

Shopware Bootstrap
6.4 Bootstrap 4
6.5 and newer Bootstrap 5

The examples on this page apply to Bootstrap 5.

If the editor changes your code

Further information

Last updated on

More from ThemeWare®: About ThemeWare® · Demoshops · Manual · Video tutorial · Utilities

This page online: https://knowledge.themeware.design/knowledge-base/tutorials/shopping-experiences/designing-shopping-experiences-with-bootstrap-html-code · ThemeWare® Service Portal, service.themeware.design