How to Get WYSIWYG Editor’s data in Magento 2 Frontend

How to Get WYSIWYG Editor's data in Magento 2 Frontend

The technique to add WYSIWYG editor in Magento 2 system configuration makes the admin’s task much easier to work with content editing.  Have you checked the frontend after implementing WYSIWYG editor in the admin configuration?

Strange output, isn’t it? 😕

You can see the inability of the WYSIWYG editor to convert the HTML content.

Magento 2 fails to convert WYSIWYG content into the readable format in the condition when the content has been added from the WYSIWYG editor from the configuration section. To resolve the issue and get WYSIWYG editor’s data in Magento 2 frontend, follow the below method:

Method to Get WYSIWYG Editor’s data in Magento 2 Frontend:

  1. Create registration.php file in app\code\[Vendor]\[Namespace]\
  2. Create module.xml file in app\code\[Vendor]\[Namespace]\etc
  3. Create ConfigBlock.php file in app\code\[Vendor]\[Namespace]\Helper

     

That’s it.

Now you can use the WYSIWYG editor in the system configuration, and at the same get proper output in the frontend!

Feel free to post your doubts in the Comments section below and I’d be happy to help.

Thanks!

4.4
(based on 7 Reviews)

Sanjay is a co-founder at Meetanshi. He is a certified Magento developer who loves creating Magento E-commerce solutions. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply