# sw\_extends  für {% sw\_extends '@Storefront/storefront/component/product/listing.html.twig' %} greift

**URL:** <https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184>\
**Category:** Themes & Design\
**Created:** [11. April 2020 um 09:51 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184 "2020-04-11T09:51:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/nerger/32/15180_2.png) [@nerger](https://forum.shopware.com/u/nerger)\
**Post date:** [11. April 2020 um 09:51 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184/1 "2020-04-11T09:51:35Z")

</div>

Hallo,

```
 in meinem Theme möchte ich die Anzahl der Spalten verändern auf drein. Habe die Datei listing.html.twig in PluginTheme/src/Resources/views/storefront/component/product/listing.html.twig angelegt. {% sw\_extends '@Storefront/storefront/component/product/listing.html.twig' %} eingefügt. Dann die Variable auf {% set listingColumns = 'col-sm-6 col-lg-4 col-xl-4' %} gesetst. Leider greif das {% sw\_extends '@Storefront/storefront/component/product/listing.html.twig' %} nicht. 

```

Kann mir da Jemand hlefen.

Besten Dank

Frank

---

<div class="post-metadata">

**Author:** ![nerger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/nerger/32/15180_2.png) [@nerger](https://forum.shopware.com/u/nerger)\
**Post date:** [11. April 2020 um 10:43 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184/2 "2020-04-11T10:43:59Z")

</div>

es lag am cache:clear funktionierte local nicht richtig.

---

<div class="post-metadata">

**Author:** ![hulk02](https://avatars.discourse-cdn.com/v4/letter/h/90db22/32.png) [@hulk02](https://forum.shopware.com/u/hulk02)\
**Post date:** [15. April 2020 um 15:56 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184/3 "2020-04-15T15:56:08Z")

</div>

Kannst du mir sagen, wo du&nbsp;{% set listingColumns = ‚col-sm-6 col-lg-4 col-xl-4‘ %} eingetragen hast?  
ich will nämlich auch auf 3 Spalten.

---

<div class="post-metadata">

**Author:** ![nerger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/nerger/32/15180_2.png) [@nerger](https://forum.shopware.com/u/nerger)\
**Post date:** [15. April 2020 um 16:25 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184/4 "2020-04-15T16:25:33Z")

</div>

> [@hulk02 schrieb:](https://forum.shopware.com/profile/22359/hulk02 "hulk02")
> 
> Kannst du mir sagen, wo du&nbsp;{% set listingColumns = ‚col-sm-6 col-lg-4 col-xl-4‘ %} eingetragen hast?  
> ich will nämlich auch auf 3 Spalten.
> 
> &nbsp;
> 
> &nbsp;
> 
> Hallo,
> 
> ich habe in meinen Theme in der Datei&nbsp; MeinPluginTheme/src/Resources/views/storefront/component/product/listing.html.twig
> 
> Fogende eingetragen.
> 
> {% sw\_extends ‚@Storefront/storefront/component/product/listing.html.twig‘ %}  
> &nbsp; &nbsp; {% set listingColumns = ‚col-sm-6 col-lg-4 col-xl-4‘ %}
> 
> {% block product\_listing %}  
> &nbsp; &nbsp; {{ parent() }}  
> {% endblock %}
> 
> &nbsp;

---

<div class="post-metadata">

**Author:** ![schnere](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/schnere/32/13444_2.png) [@schnere](https://forum.shopware.com/u/schnere)\
**Post date:** [15. September 2020 um 10:19 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184/5 "2020-09-15T10:19:00Z")

</div>

Die Spalten kann man anpassen indem man das Element-Tempalte anpasst. So bleibt die Möglichkeit bestehen das Listing mit anderer Spalten-Konfiguration an anderer Stelle einzubinden.

custom/plugins/MyCustomTheme/src/Resources/views/storefront/element/cms-element-product-listing.html.twig

```
{% sw_extends '@Storefront/storefront/element/cms-element-product-listing.html.twig' %}

{% set listingColumnsTheme = 'col-sm-6 col-lg-4 col-xl-4' %}

{% if section and section.type == 'sidebar' %}
    {% set listingColumnsTheme = 'col-sm-6 col-lg-6 col-xl-4' %}
{% endif %}

{% block element_product_listing_wrapper %}
        {% sw_include '@Storefront/storefront/component/product/listing.html.twig' with {
            searchResult: searchResult,
            dataUrl: dataUrl,
            filterUrl: filterUrl,
            params: params,
            sidebar: sidebar,
            boxLayout: element.translated.config.boxLayout.value,
            displayMode: element.translated.config.displayMode.value,
            listingColumns: listingColumnsTheme
        } %}
{% endblock %}

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![nerger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/nerger/32/15180_2.png) [@nerger](https://forum.shopware.com/u/nerger)\
**Post date:** [15. September 2020 um 10:22 UTC](https://forum.shopware.com/t/sw-extends-fur-sw-extends-storefront-storefront-component-product-listing-html-twig-greift/66184/6 "2020-09-15T10:22:28Z")

</div>

Danke
