{"id":8509,"date":"2021-06-24T10:33:22","date_gmt":"2021-06-24T10:33:22","guid":{"rendered":"https:\/\/www.bay20.com\/?p=8509"},"modified":"2025-05-21T16:15:36","modified_gmt":"2025-05-21T10:30:36","slug":"hinzufugen-von-feldern-fur-die-benutzerdefinierte-themenkonfiguration-in-shopware-5","status":"publish","type":"post","link":"https:\/\/www.bay20.com\/de\/hinzufugen-von-feldern-fur-die-benutzerdefinierte-themenkonfiguration-in-shopware-5\/","title":{"rendered":"Wie kann ich in Shopware 5 benutzerdefinierte Themenkonfigurationsfelder hinzuf\u00fcgen?"},"content":{"rendered":"\n<p>Um benutzerdefinierte Themenkonfigurationsfelder in Shopware 5 hinzuzuf\u00fcgen, f\u00fchren Sie die folgenden Schritte aus:<\/p>\n\n\n\n<p><strong>Schritt 1: <\/strong>Gehen Sie zum Shopware-Themenverzeichnis Ihrer Website.<\/p>\n\n\n\n<p><strong>Schritt 2: <\/strong>Klicken Sie auf die Datei <strong>Theme.php<\/strong>, um das Konfigurationsfeld hinzuzuf\u00fcgen.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bay20.com\/wp-content\/uploads\/2021\/05\/Screenshot_1-1.png\" alt=\"This image has an empty alt attribute; its file name is Screenshot_1-1.png\" width=\"387\" height=\"526\"\/><\/figure>\n\n\n\n<p><strong>Schritt 3: <\/strong>F\u00fcgen Sie den folgenden Code in die Datei Theme.php ein.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">use Shopware\\Components\\Form as Form<strong>;<\/strong>  \/\/container element\n\n<em>\/**\n * <\/em><strong><em>@param <\/em><\/strong><em>Form\\Container\\TabContainer $container\n *\/\n<\/em>public function createConfig(<em>Form<\/em>\\Container\\TabContainer $container)\n{\n\/\/ Create the fieldset which is the container of our field\n$fieldset = $this-&gt;createFieldSet(\n'my_custom_settings'<strong>,\n <\/strong>'My custom settings'\n)<strong>;\n\n <\/strong>\/\/ Create the textfield\n$textField = $this-&gt;createTextField(\n'basic_font_size'<strong>,\n <\/strong>'Basic font size'<strong>,\n <\/strong>'16px'\n)<strong>;\n\n <\/strong>\/\/ Create the color picker field\n$colorPickerField = $this-&gt;createColorPickerField(\n'custom-color-main'<strong>,\n <\/strong>'Main color'<strong>,\n <\/strong>'#62b74b'\n)<strong>;\n\n <\/strong>\/\/ Adding the fields to the fieldset\n$fieldset-&gt;addElement($textField)<strong>;\n <\/strong>$fieldset-&gt;addElement($colorPickerField)<strong>;\n\n <\/strong>\/\/ Create the tab which will be named \"My custom colors\"\n$tab = $this-&gt;createTab(\n'my_custom_tab'<strong>,\n <\/strong>'My custom tab'\n)<strong>;\n\n <\/strong>\/\/ add the fieldset to the tab\n$tab-&gt;addElement($fieldset)<strong>;\n\n <\/strong>\/\/ add the tab to the container, which is a tab panel.\n$container-&gt;addTab($tab)<strong>;\n<\/strong>}<\/pre>\n\n\n\n<p><strong>Schritt 4: <\/strong>Gehen Sie nun zum Themenbereich im Backend und klicken Sie auf das Feld<strong> Thema konfigurieren.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bay20.com\/wp-content\/uploads\/2021\/05\/Screenshot_2-1-980x450.png\" alt=\"This image has an empty alt attribute; its file name is Screenshot_2-1-980x450.png\" width=\"902\" height=\"414\"\/><\/figure>\n\n\n\n<p><strong>Schritt 5: <\/strong>Jetzt sehen Sie die neu erstellte <strong>Registerkarte Meine Benutzerdefinition<\/strong> wie im folgenden Screenshot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bay20.com\/wp-content\/uploads\/2021\/05\/Screenshot_6-1-980x448.png\" alt=\"\" class=\"wp-image-8512\" width=\"933\" height=\"426\" srcset=\"https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_6-1-980x448.png 980w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_6-1-300x137.png 300w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_6-1-800x366.png 800w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_6-1-768x351.png 768w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_6-1-1000x457.png 1000w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_6-1.png 1365w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/figure>\n\n\n\n<p><strong>Ergebnis:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bay20.com\/wp-content\/uploads\/2021\/05\/Screenshot_7-980x449.png\" alt=\"\" class=\"wp-image-8513\" width=\"914\" height=\"418\" srcset=\"https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_7-980x449.png 980w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_7-300x138.png 300w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_7-800x367.png 800w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_7-768x352.png 768w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/05\/Screenshot_7.png 1365w\" sizes=\"auto, (max-width: 914px) 100vw, 914px\" \/><\/figure>\n\n\n\n<p><strong>Bitte kontaktieren Sie uns unter <strong><a href=\"mailto:manish@bay20.com\">manish@bay20.com<\/a><\/strong> oder rufen Sie uns unter <a href=\"https:\/\/api.whatsapp.com\/send?phone=+918800519180&amp;text=Hi,%20I%20contacted%20you%20through%20your%20website.\" target=\"_blank\" rel=\"noreferrer noopener\">+91-8800519180<\/a> an, wenn Sie Unterst\u00fctzung zu Shopware 5 und Shopware 6 ben\u00f6tigen. Sie k\u00f6nnen auch die <strong><a href=\"https:\/\/www.bay20.com\/de\/shopware-entwicklungsunternehmen\/\">Shopware<strong>-Entwicklungsseite<\/strong><\/a><\/strong> besuchen, um die von uns angebotenen Dienstleistungen zu pr\u00fcfen.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Um benutzerdefinierte Themenkonfigurationsfelder in Shopware 5 hinzuzuf\u00fcgen, f\u00fchren Sie die folgenden Schritte aus: Schritt 1: Gehen Sie zum Shopware-Themenverzeichnis Ihrer Website. Schritt 2: Klicken Sie auf die Datei Theme.php, um das Konfigurationsfeld hinzuzuf\u00fcgen. Schritt 3: F\u00fcgen Sie den folgenden Code in die Datei Theme.php ein. use Shopware\\Components\\Form as Form; \/\/container element \/** * @param Form\\Container\\TabContainer [&hellip;]<\/p>\n","protected":false},"author":74,"featured_media":8510,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78,116],"tags":[],"class_list":["post-8509","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shopware","category-shopware-5"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/8509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/users\/74"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/comments?post=8509"}],"version-history":[{"count":7,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/8509\/revisions"}],"predecessor-version":[{"id":17281,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/8509\/revisions\/17281"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/media\/8510"}],"wp:attachment":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/media?parent=8509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/categories?post=8509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/tags?post=8509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}