{"id":1429,"date":"2017-09-23T21:53:58","date_gmt":"2017-09-23T21:53:58","guid":{"rendered":"http:\/\/inchoo.net\/?p=29697"},"modified":"2017-09-23T22:33:49","modified_gmt":"2017-09-23T22:33:49","slug":"magento-2-custom-cms-page-layout","status":"publish","type":"post","link":"https:\/\/www.sushilkumar.ind.in\/blog\/magento-2\/magento-2-custom-cms-page-layout\/","title":{"rendered":"Magento 2 Custom CMS page layout"},"content":{"rendered":"<p>We\u2019ve had a request to add a new custom layout for CMS pages in one Magento shop.<br \/>\nThis can be very useful and can save you a lot of time for different static pages of your shop.<\/p>\n<p>In this example we\u2019ll create a layout named Sushil <strong>Layout<\/strong>.<\/p>\n<p>We should focus on two <strong>xml<\/strong> files: <strong>layouts.xml<\/strong> and <strong>page_layout\/sushil -layout.xml<\/strong> under <strong>Magento_Theme<\/strong> folder.<span id=\"more-29697\"><\/span><\/p>\n<p>Create <strong>sushil<\/strong><strong>-layout.xml<\/strong> in:<\/p>\n<pre class=\"ish\"><code class=\"language-html5\">app\/design\/frontend\/_YOUR_VENDOR_\/_YOUR_THEME_\/Magento_Theme\/page_layout\/test-layout.xml<\/code><\/pre>\n<p>with content:<\/p>\n<pre class=\"ish\"><code class=\"language-text\">&lt;?xml version=\"1.0\" ?&gt;\r\n&lt;layout xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_layout.xsd\"&gt; &lt;update handle=\"empty\"\/&gt; &lt;referenceContainer name=\"page.wrapper\"&gt; &lt;container name=\"header.container\" as=\"header_container\" label=\"Page Header Container\" htmlTag=\"header\" htmlClass=\"page-header\" before=\"main.content\"\/&gt; &lt;container name=\"page.top\" as=\"page_top\" label=\"After Page Header\" after=\"header.container\"\/&gt; &lt;container name=\"footer-container\" as=\"footer\" before=\"before.body.end\" label=\"Page Footer Container\" htmlTag=\"footer\" htmlClass=\"page-footer\" \/&gt; &lt;\/referenceContainer&gt;\r\n&lt;\/layout&gt;<\/code><\/pre>\n<p>Our layout is based off the empty page layout, you can also create a layout based another layout.<br \/>\nJust replace <strong>&lt;update handle=\u201dempty\u201d\/&gt;<\/strong> with the layout you wish to use, e.g\u00a0<strong>&lt;update handle=\u201d3columns\u201d\/&gt;<\/strong><\/p>\n<p>Create layouts.xml in:<\/p>\n<pre class=\"ish\"><code class=\"language-html5\">app\/design\/frontend\/_YOUR_VENDOR\/_YOUR_THEME_\/Magento_Theme\/layouts.xml<\/code><\/pre>\n<p>with content:<\/p>\n<pre class=\"ish\"><code class=\"language-xml\"><span class=\"sc3\"><span class=\"re1\">&lt;page_layouts<\/span> <span class=\"re0\">xmlns:xsi<\/span>=<span class=\"st0\">\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"<\/span> <span class=\"re0\">xsi:noNamespaceSchemaLocation<\/span>=<span class=\"st0\">\"urn:magento:framework:View\/PageLayout\/etc\/layouts.xsd\"<\/span><span class=\"re2\">&gt;<\/span><\/span> <span class=\"sc3\"><span class=\"re1\">&lt;layout<\/span> <span class=\"re0\">id<\/span>=<span class=\"st0\">\"sushil-layout\"<\/span><span class=\"re2\">&gt;<\/span><\/span> <span class=\"sc3\"><span class=\"re1\">&lt;label<\/span> <span class=\"re0\">translate<\/span>=<span class=\"st0\">\"true\"<\/span><span class=\"re2\">&gt;<strong>Sushil <\/strong><\/span><\/span>Layout<span class=\"sc3\"><span class=\"re1\">&lt;\/label<span class=\"re2\">&gt;<\/span><\/span><\/span> <span class=\"sc3\"><span class=\"re1\">&lt;\/layout<span class=\"re2\">&gt;<\/span><\/span><\/span>\r\n<span class=\"sc3\"><span class=\"re1\">&lt;\/page_layouts<span class=\"re2\">&gt;<\/span><\/span><\/span><\/code><\/pre>\n<p>Now, our custom layout is in the list of layouts.<\/p>\n<p><strong>Frontend:<\/strong><br \/>\n<a href=\"\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/magento-2-custom-cms-page-layout.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-29708 size-full\" src=\"\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/magento-2-custom-cms-page-layout.png\" alt=\"\" width=\"620\" height=\"153\" \/><\/a><\/p>\n<p><strong>Note:<\/strong> Clear cache! \ud83d\ude09<\/p>\n<p>The post Magento 2 Custom CMS page layout appeared first on <strong>Sushil Kumar<\/strong>.<\/p>\n<p><a href=\"\/\/www.sushilkumar.ind.in\/custome-devlopment\/\">Do you need any custome Development Click here and fill the form with full your requirement<\/a> and after i will send the quotes of your work requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve had a request to add a new custom layout for CMS pages in one Magento shop. This can be very useful and can save you a lot of time for different static pages of your shop. In this example we&#8217;ll create a layout named Inchoo Layout. We should focus on two xml files: layouts.xml&#8230;<br \/>\nThe post Magento 2 Custom CMS page layout appeared first on Inchoo. Do you need any custome Development Click here and fill the form with full your requirement  and after i will send the quotes of your work requirements&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":1430,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[255,263,256,225,264,20,265],"tags":[259,266,260,230,267,22,268],"class_list":["post-1429","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-administration","category-cms","category-configuration","category-frontend","category-layout","category-magento-2","category-xml","tag-administration","tag-cms","tag-configuration","tag-frontend","tag-layout","tag-magento-2","tag-xml"],"jetpack_publicize_connections":[],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-content\/uploads\/2017\/09\/magento-2-custom-cms-page-layout.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p99pkJ-n3","_links":{"self":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts\/1429"}],"collection":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/comments?post=1429"}],"version-history":[{"count":0,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts\/1429\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/media\/1430"}],"wp:attachment":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/media?parent=1429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/categories?post=1429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/tags?post=1429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}