How To

How to Add Custom Layout Dropdown on CMS page after Magento 2.3.4

Hello Magento Friends ?,

Hope you are doing great. Today I will show How to Add Custom Layout Dropdown on CMS Page after Magento 2.3.4. In any case, you missed our last blog, take a glance at How to Implement Multiselect Filter for Order Status in Magento 2 Order Grid.

Magento never remains at the rear side when it comes to modifications and new updates. These upgrades come to the aid for Magento store owners and benefit them to go ahead in the competition race.

Magento 2 Custom Layout Update dropdown on the CMS Page after 2.3.4 offers improved security. Instead of manual entry, it provides a dropdown picker for custom layout update. 

Let’s start ?

Steps to Add Custom Layout Dropdown on CMS page after Magento 2.3.4:

Step 1: Firstly, you need to create a layout in your theme folder.

app/design/frontend/Vendor/Theme/Magento_Cms/layout/cms_page_view_selectable_<identifier>_<layoutname>.xml

Say for an example:

app/design/frontend/Vendor/Theme/Magento_Cms/layout/cms_page_view_selectable_about-us_custom.xml

Inside the  file enter CSS or JS or any custom code as shown below:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="Vendor_Extension/css/aboutus.css"/>
    </head>
</page>

Step 2: Now, fire Caching Command

php bin/magento cache:flush

Step 3: Select the custom layout update from the backend.

  • From the Admin sidebar, browse Content > Settings > Pages
  • Select a specific CMS page and open it in edit mode.
  • Expand the Design tab, in the Custom Layout Update field choose the layout update you want to apply to the page.
  • Hit the Save button.

Then vs Now (CMS Page Layout):

Magento 2.3.3 Layout

Magento 2.3.4 Layout

Conclusion:

Now that you know How to Add Custom Layout Dropdown on CMS page, do it without delay. If you come across any complications, mention in the comment part. I will be happy to solve it. Do share it with your Magento friends. Stay in the know.

Happy Updating ?

Click to rate this post!
[Total: 10 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

View Comments

  • Hi,
    I have followed your steps but the custom layout does not appear on Custom Layout Update in admin, any ideas as to why?

Recent Posts

Five Essential Payroll Compliance Tips for eCommerce Startups

Are you setting up a payroll system for your eCommerce startup? Ensuring compliance with myriad…

3 hours ago

Optimizing Laravel Blade: Unlocking Advanced Fetcher Techniques

In the expansive universe of Laravel development, Blade serves as the stellar templating engine, propelling…

5 hours ago

Magento 2: Add Quantity Increment and Decrement on Category Page

Hello Magento Friends, In this blog, we will discuss about adding quantity increment and decrement…

2 days ago

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

5 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

1 week ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

1 week ago