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.
Opening the modal
Section titled “Opening the modal”- Go to Content → Shopping Experiences.
- Open the layout you want to make conditional.
- In the right sidebar, click Layout assignment.
- Click the Assign layout button.
- The modal opens with tabs: Categories, Products, Landing pages, and the new Rules tab added by this plugin.
The Rules tab
Section titled “The Rules tab”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.
Status badges
Section titled “Status badges”- ✓ 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.
How multiple rules combine
Section titled “How multiple rules combine”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.
Saving
Section titled “Saving”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 other tabs are unchanged
Section titled “The other tabs are unchanged”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.
Related
Section titled “Related”- Rules and conditions — what to put inside a rule.
- Custom rule conditions — the three conditions added by this plugin.
- First layout replacement — the modal in context.