How to write text file and create directory in Magento 2 standard way?

You can write the content dynamically in text(.txt) file using Programmatic way with Magento 2 Standard approach.

Sometimes you need to create a directory and write a text file in the specific location of the system, You can add the content with interface Magento\Framework\Filesystem\Directory\WriteInterface. Continue reading “How to write text file and create directory in Magento 2 standard way?”

How to add Cms Page Custom Layout Update file in Magento 2.3.4?

From Magento 2.3.4, For the security enhancements, default custom layout update Textarea removed from the CMS page admin section.

If you want to add XML code snippet for the CMS Page, You must have to create a CMS Page layout handle for the page.

If you want to add Custom layout update code for the About Us page, You need to create a unique XML handle for the CMS page. Continue reading “How to add Cms Page Custom Layout Update file in Magento 2.3.4?”

How to add Category Custom Layout Update XML file in Magento 2.3.4?

From Magento 2.3.4, Custom Layout Update Textarea removed from the admin panel category edit page, product edit page and cms edit page to remove the opportunity of Remote Code Execution (RCE). Replace Textarea with a selector.

Earlier you can add directly XML code snippet for the specific entity from the backend but from Magento 2.3.4 new feature was added. You need to create an XML file in your theme or module level and assign an XML file to the Custom Layout Update selector. Continue reading “How to add Category Custom Layout Update XML file in Magento 2.3.4?”