{"id":7865,"date":"2021-05-02T11:51:58","date_gmt":"2021-05-02T11:51:58","guid":{"rendered":"https:\/\/www.bay20.com\/?p=7865"},"modified":"2025-05-21T16:32:35","modified_gmt":"2025-05-21T10:47:35","slug":"anleitung-zum-hinzufugen-von-benutzerdefinierten-cms-seiten-layout-in-magento-2","status":"publish","type":"post","link":"https:\/\/www.bay20.com\/de\/anleitung-zum-hinzufugen-von-benutzerdefinierten-cms-seiten-layout-in-magento-2\/","title":{"rendered":"Wie f\u00fcgt man Custom CMS Seitenlayout in Magento 2?"},"content":{"rendered":"\n<p>Wir werden ein benutzerdefiniertes Layout mit dem Namen <strong>Knowband Layout <\/strong>erstellen.<\/p>\n\n\n\n<p>Erstellen Sie ein neues Modul mit <strong>CustomLayout_CustomCMS.<\/strong><\/p>\n\n\n\n<p><strong>Schritt 1:<\/strong> Erstellen Sie die Datei <strong>registration.php.<\/strong><\/p>\n\n\n\n<p>app\/design\/frontend\/CustomLayout\/CustomCMS\/registration.php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n\t\\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n\t'CustomLayout_CustomCMS',\n\t__DIR__\n);\n<\/code><\/pre>\n\n\n\n<p><strong>Schritt 2:<\/strong> Erstellen Sie die Datei <strong>module.xml.<\/strong><\/p>\n\n\n\n<p>app\/design\/frontend\/CustomLayout\/CustomCMS\/etc\/module.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module\/etc\/module.xsd\"&gt;\n    &lt;module name=\"CustomLayout_CustomCMS\" setup_version=\"1.0.0\"&gt;\n    &lt;\/module&gt;\n&lt;\/config&gt;<\/code><\/pre>\n\n\n\n<p><strong>Schritt 3:<\/strong> Erstellen Sie die Datei <strong>kb_layout.xml.<\/strong><\/p>\n\n\n\n<p>app\/design\/frontend\/CustomLayout\/CustomCMS\/view\/frontend\/page_layout\/kb_layout.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n \n&lt;layout xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_layout.xsd\"&gt;\n \n&lt;update handle=\"empty\"\/&gt;&lt;!-- you can change the handle like 2columns-left or 3columns etc--&gt;\n \n&lt;referenceContainer name=\"page.wrapper\"&gt;\n \n&lt;container name=\"header.container\" as=\"header_container\" label=\"Page Header Container\"  htmlTag=\"header\" htmlClass=\"page-header\" before=\"main.content\"\/&gt;\n \n&lt;container name=\"page.top\" as=\"page_top\" label=\"After Page Header\" after=\"header.container\"\/&gt;\n \n&lt;container name=\"footer-container\" as=\"footer\" after=\"-\" label=\"Page Footer Container\" htmlTag=\"footer\" htmlClass=\"page-footer\" \/&gt;\n \n&lt;\/referenceContainer&gt;\n \n&lt;\/layout&gt;<\/code><\/pre>\n\n\n\n<p><strong>Schritt 4: <\/strong>Erstellen Sie die Datei <strong>layouts.xml.<\/strong><\/p>\n\n\n\n<p>app\/design\/frontend\/CustomLayout\/CustomCMS\/view\/frontend\/layouts.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n \n&lt;page_layouts xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/PageLayout\/etc\/layouts.xsd\"&gt;\n \n&lt;layout id=\"kb_layout\"&gt;\n \n&lt;label translate=\"true\"&gt;Knowband Layout&lt;\/label&gt;\n \n&lt;\/layout&gt;\n \n&lt;\/page_layouts&gt;<\/code><\/pre>\n\n\n\n<p><strong>Schritt 5:<\/strong> F\u00fchren Sie den folgenden Befehl aus.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento setup:upgrade<\/code><\/pre>\n\n\n\n<p>Nachdem Sie diese Dateien erstellt haben, wird Ihr benutzerdefiniertes Layout der Layoutliste hinzugef\u00fcgt.<\/p>\n\n\n\n<p>Gehe zu <strong>Admin panel <\/strong>&gt; <strong>Content<\/strong> &gt; Pages &gt; <strong>Add New Page<\/strong> &gt; <strong>Design<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"980\" height=\"363\" src=\"https:\/\/www.bay20.com\/wp-content\/uploads\/2021\/03\/21-980x363.png\" alt=\"\" class=\"wp-image-7869\" srcset=\"https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21-980x363.png 980w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21-300x111.png 300w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21-800x296.png 800w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21-768x284.png 768w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21-1536x568.png 1536w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21-1000x370.png 1000w, https:\/\/www.bay20.com\/de\/wp-content\/uploads\/2021\/03\/21.png 1884w\" sizes=\"auto, (max-width: 980px) 100vw, 980px\" \/><\/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 <strong><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><\/strong> an, wenn Sie Unterst\u00fctzung f\u00fcr Magento 2 ben\u00f6tigen. Sie k\u00f6nnen auch die <strong><a href=\"https:\/\/www.bay20.com\/de\/magento-entwicklungsunternehmen\/\">Magento2<strong>-Entwicklungsseite<\/strong><\/a><\/strong> besuchen, um die von uns angebotenen Dienstleistungen zu \u00fcberpr\u00fcfen.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create custom layout with named Knowband Layout. Create a new module with CustomLayout_CustomCMS.<\/p>\n","protected":false},"author":1,"featured_media":8416,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77,79],"tags":[],"class_list":["post-7865","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento2","category-magento-anleitung"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/7865","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/comments?post=7865"}],"version-history":[{"count":8,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/7865\/revisions"}],"predecessor-version":[{"id":17294,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/posts\/7865\/revisions\/17294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/media\/8416"}],"wp:attachment":[{"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/media?parent=7865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/categories?post=7865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bay20.com\/de\/wp-json\/wp\/v2\/tags?post=7865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}