From fe98bc82fd43fcda7aaba46024b8d974807b6098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20K=C3=B6rtgen?= Date: Fri, 10 Apr 2026 10:03:52 +0200 Subject: [PATCH 1/7] Add entity single select for mail templates sample showing label-property usage --- .../plugin-fundamentals/add-plugin-configuration.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index c87a1f221..4e93f14d0 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -271,7 +271,18 @@ Here are some examples: ``` -Stores the ID of the selected product into the system config. +### Entity single select for mail templates + +```html + + exampleMailTemplate + mail_template + description + + +``` + +Stores the ID of the selected mail template into the system config. Displays the mail templates description in the administration. ### Entity multi ID select for products From 32210155714d2fd326493288469fd29530b16308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20K=C3=B6rtgen?= Date: Fri, 10 Apr 2026 10:09:31 +0200 Subject: [PATCH 2/7] Update add-plugin-configuration.md with mail template info Add explanation for storing selected mail template ID. --- .../plugins/plugin-fundamentals/add-plugin-configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index 4e93f14d0..3587f2cd2 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -271,6 +271,8 @@ Here are some examples: ``` +Stores the ID of the selected mail template into the system config. + ### Entity single select for mail templates ```html From 1f966fd6a6ba5b8c90a07176bc34e62b2f7927d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20K=C3=B6rtgen?= Date: Fri, 10 Apr 2026 10:10:06 +0200 Subject: [PATCH 3/7] Update documentation to reflect product selection change --- .../plugins/plugin-fundamentals/add-plugin-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index 3587f2cd2..79efd6245 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -271,7 +271,7 @@ Here are some examples: ``` -Stores the ID of the selected mail template into the system config. +Stores the ID of the selected product into the system config. ### Entity single select for mail templates From fa3ce17a54d9d2277c0425b09884740eca6fb57e Mon Sep 17 00:00:00 2001 From: Micha Hobert Date: Fri, 10 Apr 2026 11:26:18 +0200 Subject: [PATCH 4/7] Update guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../plugins/plugin-fundamentals/add-plugin-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index 79efd6245..6ddbc0425 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -284,7 +284,7 @@ Stores the ID of the selected product into the system config. ``` -Stores the ID of the selected mail template into the system config. Displays the mail templates description in the administration. +Stores the ID of the selected mail template into the system config. Displays the mail template description in the Administration. ### Entity multi ID select for products From 48c84bb03d3a4ea139ecdbf9d1da31c99503bb77 Mon Sep 17 00:00:00 2001 From: Micha Date: Tue, 28 Apr 2026 10:00:12 +0200 Subject: [PATCH 5/7] add/info-about-label-usage --- .../add-plugin-configuration.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index 6ddbc0425..6e26abf0b 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -32,7 +32,7 @@ Below you'll find an example structure: ├── src │ ├── Resources │ │ └── config - │ │ └── config.xml + │ │ └── config.xml │ └── SwagBasicExample.php └── composer.json ``` @@ -273,19 +273,6 @@ Here are some examples: Stores the ID of the selected product into the system config. -### Entity single select for mail templates - -```html - - exampleMailTemplate - mail_template - description - - -``` - -Stores the ID of the selected mail template into the system config. Displays the mail template description in the Administration. - ### Entity multi ID select for products ```html @@ -330,6 +317,22 @@ Allows you to edit snippet values within the configuration page. This component does not store values in the system config, but changes the translations for the snippet key. **Note: This field is only available from 6.3.4.0 onward.** +### Entity selects without a name field + +Some entities do not have a `name` field, which is used per default in the select components. For example, the `mail_template` entity does not have a name field, but you can still use `description` as a `label-property` to select mail templates in your plugin configuration. Without it, the select field would be empty and not usable. You can check available properties for an entity in the `EntityDefinition` of the entity (in this case `Shopware\Core\Content\MailTemplate\MailTemplateDefinition`). + + +```html + + exampleMailTemplate + mail_template + description + + +``` + +Stores the ID of the selected mail template into the system config. + ### Supported component types Please Note: It is impossible to allow every component in the `config.xml`, due to their complexities. From 49cc1754da7a3c8df2665d7eba98f3befc7a843f Mon Sep 17 00:00:00 2001 From: Micha Date: Tue, 28 Apr 2026 10:13:01 +0200 Subject: [PATCH 6/7] edit/xml-view --- .../add-plugin-configuration.md | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index 6e26abf0b..28ef29d6e 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -48,8 +48,9 @@ You can organize the content in `` elements. Every `config.xml` must contain a minimum of one `` element and each `` must contain one `` and at least one `<input-field>`. See the minimum `config.xml` below: -```xml -<!--<plugin root>/src/Resources/config/config.xml--> +::: code-group + +```xml [PLUGIN_ROOT/src/Resources/config/config.xml] <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/trunk/src/Core/System/SystemConfig/Schema/config.xsd"> @@ -62,6 +63,8 @@ See the minimum `config.xml` below: </config> ``` +::: + Please make sure to specify the `xsi:noNamespaceSchemaLocation` as shown above and fetch the external resource into your IDE if possible. This enables auto-completion and suggestions for this XML file and will therefore help you to prevent issues and bugs. @@ -92,23 +95,23 @@ Your `<input-field>` can be of different types, this is managed via the `type` a Unless defined otherwise, your `<input-field>` will be a text field. Below you'll find a list of all available `<input-field type="?">`. -| Type | Configuration settings | Renders | Default value example | -|:--------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:----------------------------------------| +| Type | Configuration settings | Renders | Default value example | +|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------|:----------------------------------------| | text | [copyable](add-plugin-configuration.md#copyable), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text), [length](add-plugin-configuration.md#text-length-restrictions) | Text field | Some text | -| textarea | [copyable](add-plugin-configuration.md#copyable), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | Text area | Some more text | -| text-editor | [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | HTML editor | Some text with HTML `<div>`tags`</div>` | -| url | [copyable](add-plugin-configuration.md#copyable), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text), [length](add-plugin-configuration.md#text-length-restrictions) | URL field | <https://example.com> | -| password | [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text), [length](add-plugin-configuration.md#text-length-restrictions) | Password field | ******** | -| int | [length](add-plugin-configuration.md#number-length-restrictions) | Number field | 42 | -| float | [length](add-plugin-configuration.md#number-length-restrictions) | Number field | 42.42 | -| bool | | Switch | `true` or `false` | -| checkbox | | Checkbox | `true` or `false` | -| datetime | | Date-time picker | 2024-04-04T12:00:00.000Z | -| date | | Date picker | 2024-04-05T00:00:00 | -| time | | Time picker | 11:00:00 | -| colorpicker | | Color picker | #189EFF | -| single-select | [options](add-plugin-configuration.md#options), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | Single-Select box | option_id | -| multi-select | [options](add-plugin-configuration.md#options), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | Multi-Select box | [option_id1, option_id2] | +| textarea | [copyable](add-plugin-configuration.md#copyable), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | Text area | Some more text | +| text-editor | [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | HTML editor | Some text with HTML `<div>`tags`</div>` | +| url | [copyable](add-plugin-configuration.md#copyable), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text), [length](add-plugin-configuration.md#text-length-restrictions) | URL field | <https://example.com> | +| password | [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text), [length](add-plugin-configuration.md#text-length-restrictions) | Password field | ******** | +| int | [length](add-plugin-configuration.md#number-length-restrictions) | Number field | 42 | +| float | [length](add-plugin-configuration.md#number-length-restrictions) | Number field | 42.42 | +| bool | | Switch | `true` or `false` | +| checkbox | | Checkbox | `true` or `false` | +| datetime | | Date-time picker | 2024-04-04T12:00:00.000Z | +| date | | Date picker | 2024-04-05T00:00:00 | +| time | | Time picker | 11:00:00 | +| colorpicker | | Color picker | #189EFF | +| single-select | [options](add-plugin-configuration.md#options), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | Single-Select box | option_id | +| multi-select | [options](add-plugin-configuration.md#options), [placeholder](add-plugin-configuration.md#label-placeholder-and-help-text) | Multi-Select box | [option_id1, option_id2] | ### Input field settings @@ -352,8 +355,9 @@ Full multi-card `config.xml` example (collapse to focus on smaller snippets abov <details> <summary>Full example <code>config.xml</code></summary> -```xml -<!--<plugin root>/src/Resources/config/config.xml--> +::: code-group + +```xml [PLUGIN_ROOT/src/Resources/config/config.xml] <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/trunk/src/Core/System/SystemConfig/Schema/config.xsd"> @@ -408,6 +412,8 @@ Full multi-card `config.xml` example (collapse to focus on smaller snippets abov </config> ``` +::: + </details> ## Add values to your configuration From bf3cdf2e48353fc524deb624ccc044a56f84c1f1 Mon Sep 17 00:00:00 2001 From: Micha <m.hobert@shopware.com> Date: Tue, 28 Apr 2026 10:14:41 +0200 Subject: [PATCH 7/7] fix/md --- .../plugins/plugin-fundamentals/add-plugin-configuration.md | 1 - 1 file changed, 1 deletion(-) diff --git a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md index 28ef29d6e..eed848378 100644 --- a/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md +++ b/guides/plugins/plugins/plugin-fundamentals/add-plugin-configuration.md @@ -324,7 +324,6 @@ This component does not store values in the system config, but changes the trans Some entities do not have a `name` field, which is used per default in the select components. For example, the `mail_template` entity does not have a name field, but you can still use `description` as a `label-property` to select mail templates in your plugin configuration. Without it, the select field would be empty and not usable. You can check available properties for an entity in the `EntityDefinition` of the entity (in this case `Shopware\Core\Content\MailTemplate\MailTemplateDefinition`). - ```html <component name="sw-entity-single-select"> <name>exampleMailTemplate</name>