Skip to content

Layout assignment modal

The plugin extends Shopware’s native Layout assignment modal (Shopping Experiences → open layout → Layout assignment → Assign layout) with a new Rules tab. This is where you wire a rule to a layout.

  1. Go to Content → Shopping Experiences.
  2. Open the layout you want to make conditional.
  3. In the right sidebar, click Layout assignment.
  4. Click the Assign layout button.
  5. The modal opens with tabs: Categories, Products, Landing pages, and the new Rules tab added by this plugin.

The Rules tab contains:

  • A callout explaining that “You can also assign rules to the layout to control the visibility. All rules assigned to the layout must be met for the layout to be active.”
  • A search-and-assign input where you pick rules from your existing rule library (created under Settings → Rules).
  • A list of currently assigned rules, with:
    • Rule Name — the admin label.
    • Status — a badge showing whether the rule’s conditions are fully supported, partially supported, or entirely unsupported by this plugin.
  • All conditions defined in this rule are supported — the rule will evaluate exactly as written.
  • Not all conditions defined in this rule are supported — supported conditions are evaluated, unsupported ones are skipped silently. The rule still counts as a match if the supported conditions match.
  • This rule does not contain any supported conditions and will be ignored — the rule cannot match. The plugin will never pick this layout because of this rule.

The hint button next to the column header says: “Here you can check if all conditions defined in a rule are supported. Not supported conditions will be ignored.”

See Rules and conditions → Supported conditions for the full list of what counts as supported.

Rules attached to the same layout are AND-ed. Every rule must match for the layout to become a candidate replacement. To express OR semantics, attach a single rule with an OR container inside, rather than two separate rules.

After picking your rules and clicking Confirm, save the layout from the main editor (top-right). The assignment is stored in the p2lab_cms_assigner_cms_page_to_rule table.

The Categories, Products and Landing pages tabs behave exactly as Shopware ships them — they still do hard assignment of a layout to a specific category, product or landing page. The plugin does not change that behaviour; it only adds the Rules tab as a parallel dimension.

You can mix them: a layout can have direct category assignments and rules. The category assignment makes the layout the base for that category; the rules make the same layout a candidate replacement for other categories.