Zum Inhalt springen
Termin buchen
Shopware 6 Manual

recursive category layout

With the plugin it is possible to transfer the category layout of the superordinate category to all subordinate categories (recursively) with one click. Link to documentation: https://docs.google.com/document/d/1qhFmN_YoFccgKp9fSkSbe_B4iVItV2zQne5MIIoYntI/edit?usp=sharing

Version 6.07.00 Compatible with 6.7 and newer 13 min read
On this page

Introduction

Recursive Category Layout gives a whole category tree a new layout. One click on the parent category is enough, instead of touching every category on its own.

In Shopware, every category has its own layout. A subcategory does not take over the layout of its parent category by itself. If a few hundred subcategories sit below one category, that means without the plugin: open the category, pick the layout, save, next category. The plugin adds a new button to the Layout tab of every category: Change layout for children. One click passes the layout on to every subcategory below, down to the last level.

What you get out of this plugin

  • One click instead of a working day. You switch all subcategories of a category in one go. At the next season change or relaunch it is one click again.
  • No category slips through. The plugin reaches every subcategory, no matter how deep it sits in the tree. Nobody has to remember which ones are already done.
  • Sections stay separate. If you click on the outlet, only the categories below the outlet change. Everything above and next to it keeps its layout.
  • One layout for many pages. What gets passed on is the assignment, not a copy. If you later change a text in the layout, you see it on all pages at once.
  • A confirmation comes first. Before anything is passed on, the Administration asks. With Cancel, nothing changes.

Who is this plugin for?

For anyone who maintains many categories across several levels in Shopware. For example a spare parts retailer who sorts by make, model and series and wants to switch hundreds of model pages at once. Or a furniture retailer whose outlet should look different from the rest of the shop. And every shop that gets a new standard layout after a relaunch.

Installation

Once you have added the plugin from the Shopware Store, it is available right in your Administration. You don’t need to download anything.

  1. Log in to your Shopware Administration (yourshop.com/admin).
  2. Open Extensions → My extensions.
  3. Click Install next to recursive category layout.
  4. Activate the plugin with the switch to the left of the plugin icon. Done.

Plugin in My extensions

Fig. 1: recursive category layout under Extensions → My extensions, installed and active

If recursive category layout does not show up in the list, your shop is not yet connected to your Shopware account. You can do that under Extensions → My extensions in the Shopware Account tab.

Getting Started

There is nothing to set up. As soon as the plugin is active, you find the new button on every category.

  1. Open a category: Go to Products → Categories and click a category in the category tree on the left that has further categories below it.
  2. Open the Layout tab: On the right, switch to the Layout tab. Under Layout assignment you now see the new Change layout for children button, directly above Shopware’s Change layout button. “Children” means the subcategories.
  3. Start small: For your first run, pick a branch with only a few subcategories and go through the steps in How to pass a layout on to all subcategories. That way you see in a few minutes how the plugin works.

Settings

There is nothing to set up. The plugin works as soon as it is active.

There is a configuration page anyway. You reach it via Extensions → My extensions, where you click Configure next to recursive category layout.

Plugin configuration page

Fig. 2: The configuration page with the Configuration Channel section

Under Configuration Channel you find three things:

  • Sales Channel: Here you choose which sales channel you are looking at the settings below for. By default it says All Sales Channels. For this plugin you don’t need to change anything here.
  • to documentation: This button takes you to the plugin documentation. Handy if you want to look something up straight from the Administration.
  • Activate plugin for this channel: You don’t need this switch. The Change layout for children button works the same whether the switch is on or off. It is off by default, and you can leave it that way. More on this under For Administrators / Technical Details.

How to Use the Plugin

How to pass a layout on to all subcategories

What this gives you: You assign the layout once to the parent category, and every category below gets it with one click, across all levels. In the example, “Office equipment” gets the layout “Listing with advice note”. Afterwards “Workstation”, “Packaging”, “Lighting” and everything below them have it as well, down to “Desks” and “Office chairs”.

Step by step

  1. Open the category. Go to Products → Categories, click the parent category in the category tree, “Office equipment” in the example, and switch to the Layout tab.

    Layout tab with the new button

    Fig. 3: Layout tab of the category “Office equipment”. Under Layout assignment the new button sits above “Change layout”.

  2. Assign the layout. Under Layout assignment, click Change layout. The Select layout dialog opens. Tick the layout you want and click Save. You create the layouts themselves under Content → Shopping Experiences. If the category already has the right layout, skip this step.

    Select layout dialog

    Fig. 4: In “Select layout”, “Listing with advice note” is ticked.

  3. Save the category. Click Save at the top right. As long as the category has unsaved changes, Change layout for children is greyed out. That way a layout is never passed on that isn’t even saved on the category itself. Once you have saved, the button is available.

    Button greyed out before saving

    Fig. 5: New layout chosen but not saved yet. The button is greyed out.

    Button active after saving

    Fig. 6: After saving, the button is active.

    Tip: Right after you switch the layout, the button may look active for a moment before it locks. So always save first, then click.

  4. Click the button. Click Change layout for children. A confirmation appears with the title “Select the layout for the following child directories” and the text “Are you sure you want to choose this layout for all subcategories?”

    Confirmation before passing the layout on

    Fig. 7: The confirmation with Save and Cancel

    Important: Clicking Save replaces the layout of all subcategories, including those that had a different layout before. If a section below should keep its own layout, work from top to bottom as described in How to plan different layouts for individual sections.

  5. Confirm. Click Save. With Cancel you close the confirmation and nothing changes. After saving, the Administration shows “Success!” and “The Layout was successfully added to all subcategories.” at the top right. The parent category itself stays as it is. You already saved it in step 3.

    Success message

    Fig. 8: The success message at the top right

  6. Spot-check. Click a subcategory further down in the category tree, “Desks” in the example, two levels below “Office equipment”. In the Layout tab, Layout assignment now shows the new layout.

    Subcategory with the new layout

    Fig. 9: The subcategory “Desks” has taken over the layout “Listing with advice note”.

How to check the result in your shop

What this gives you: You see for yourself that your customers get the new layout on every subcategory.

  1. Open your shop in the browser.
  2. Go to a subcategory, ideally one from the lowest level. In the example that is Office equipment, Workstation, Desks.
  3. The page is now built like the new layout. In the example, the notice “Does the part fit? Give us a call.” from the layout “Listing with advice note” sits at the top, with the listing below.

Subcategory in the shop

Fig. 10: The category “Desks” in the shop, with the notice from the new layout

Tip: If the shop still shows the old layout, see The category still looks the same in the shop under Troubleshooting.

How to plan different layouts for individual sections

What this gives you: Your category tree gets a clear order that everyone on your team understands. One standard layout for everything, separate layouts for sections such as an outlet, plus a few individual cases. At the next relaunch you repeat the same steps in the same order.

The plugin only ever passes a layout on to the categories below the category you click on. Everything above and next to it stays as it is. So you work from top to bottom. Here is an example with a furniture shop:

  1. Standard layout first. Open the top category, for example “Furniture”. Assign your standard layout in the Layout tab, save and click Change layout for children. Now every category below has the standard layout, including the outlet.
  2. Then the sections with their own layout. Open the category “Outlet”, assign the outlet layout there, save and click Change layout for children here as well. Only the categories below “Outlet” are switched. Living or Bedroom stay as they are.
  3. Individual cases last. A single promotion page, such as “Garden furniture season start”, you switch directly in its Layout tab via Change layout and save.

You don’t have to start at the very top. If you only want to redesign the outlet, step 2 is enough.

Tip: Write the order down once, for example “Furniture: standard. Outlet: outlet layout. Garden furniture season start: promotion.” If you later click at the very top again, the outlet and the individual cases get the standard layout as well. With your list, steps 2 and 3 are repeated in a few minutes, even by someone who hasn’t known the shop for years.

Troubleshooting

The “Change layout for children” button is greyed out

Why it happens: The category has changes that are not saved yet. Sometimes Shopware also marks a category as changed right after you open it, even though you haven’t touched anything. Less often, you lack the right to edit categories.

How to fix it:

  1. Click Save at the top right. After that the button is available.
  2. If it stays greyed out, ask the person who manages users and their rights in your shop. Only users who may edit categories can use the button.

The button is missing completely

Why it happens: The plugin is not active yet, or the Administration has not loaded the change yet.

How to fix it:

  1. Open Extensions → My extensions and check that the switch next to recursive category layout is on.
  2. Reload the Administration in your browser.
  3. If the button is still missing, open Settings → System → Caches & indexes and click Clear cache.

”Error!” appears after the click

Why it happens: The Administration could not finish passing the layout on. It then shows “Error!” and “Something went wrong!”.

How to fix it:

  1. Reload the Administration in your browser and open the category again.
  2. In the Layout tab, check that Layout assignment shows the right layout and that the category is saved.
  3. Click Change layout for children again.
  4. If the message comes back, contact Support and tell us which category you clicked on.

A subcategory now has the wrong layout

Why it happens: The category sits below the category you passed the layout on from.

How to fix it:

  1. Open the subcategory under Products → Categories and switch to the Layout tab.
  2. Click Change layout, tick the layout you want and click Save in the dialog.
  3. Click Save at the top right.

If a whole section has the wrong layout, do the same on its parent category and then click Change layout for children there.

The category still looks the same in the shop

Why it happens: Your shop is still showing a cached version of the page.

How to fix it:

  1. Reload the page in your browser.
  2. If nothing changes, open Settings → System → Caches & indexes and click Refresh cache.

All settings

Every setting in the plugin configuration with its default value, in the order shown in the Administration. As of version 6.07.00.

Configuration Channel

SettingDefaultDescription
Activate plugin for this channeloff

FAQ

Q: Are the subcategories of subcategories changed as well?

A: Yes. The plugin works recursively. Every level below the category you click on gets the layout.

Q: Do I have to start at the top of the category tree?

A: No. You can start at any category that has further categories below it. Only what sits below it is changed.

Q: Do new subcategories get the layout automatically?

A: No. The transfer runs once, when you click. You switch a single new category directly in its Layout tab. If a whole branch is added, say a new manufacturer with 40 models, you click Change layout for children on its parent category. The rest of your tree stays untouched.

Q: Is customised content of the parent category passed on too?

A: No. What gets passed on is the layout assignment. Texts or images you customised on a single category in the Layout tab stay with that category. You recognise such customisations by the notice “Some inherited fields have been unlinked. Reset all fields.” under Layout assignment. Content that should be the same everywhere goes into the layout itself under Content → Shopping Experiences.

Q: What if I clicked by mistake?

A: There is always a confirmation before the transfer. With Cancel, nothing changes. If you have already confirmed, assign the previous layout to the parent category again, save and pass it on to the subcategories once more. Individual exceptions you then switch directly in their Layout tab.

Q: Does it work with my theme?

A: Yes. The plugin only works in the Administration and sets the same layout assignment you would otherwise set by hand. How the layout looks in the shop is up to your Shopping Experiences and your theme.

Q: What happens when I uninstall the plugin?

A: The assigned layouts stay on the categories. They are regular Shopware settings that you keep changing in the Layout tab.

For Administrators / Technical Details

This section is meant for technical administrators. You don’t need it for everyday use.

System requirements

  • Shopware: 6.7, from 6.7.0. Tested with Shopware 6.7.16.1.
  • PHP: 8.2 or later, as Shopware 6.7 requires.

What the plugin changes in your system

  • The plugin only works in the Administration. When you click, it sets the layout assignment on all subcategories of the chosen category, the same one you would otherwise set by hand in the Layout tab. It does not touch the Storefront or the theme.
  • It creates no tables of its own, no custom fields and ships no database migrations.
  • The transfer only runs when someone clicks the button. Nothing runs in the background.
  • Only users who may edit categories in the Administration can use the button.
  • The plugin sends no data to external servers and processes no personal data.

The “Activate plugin for this channel” switch

The switch on the configuration page has no effect. It will be removed with the next release. In Shopware, the layout of a category applies to all sales channels the category appears in anyway.


This manual was written for Recursive Category Layout version 6.07.00.

How much help do you need?

  • Updates and compatibility: Plugin-Care from €149 per month

    Before every Shopware release we check whether your plugins keep up. You get a written recommendation and install the updates yourself. Cancel monthly.

    See Plugin-Care
  • Setup or customisation: intro call

    Want us to set up the plugin, or are you missing a feature? We sort that out in a free intro call.

    Book an intro call

Need a team that keeps your shop running?

We have been working with Shopware since 2010 and maintain shops including updates, hotfixes and the plugins you are configuring right now.