How to avoid PrestaShop WYSIWYG editor to clear Microdata?

337 Views Asked by At

I use PrestaShop to create some CMS pages in HTML. I would like to add some Schema.org structured data into my code, but when I paste the HTML and save the page, all the Microdata disappears. I guess the WYSIWYG editor doesn't allow me to add that.

Example

<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">

PrestaShop keeps the <div> and clears the Microdata attributes. Do you know a way to solve that?

2

There are 2 best solutions below

0
gennaris On BEST ANSWER

Make sure that in your backoffice Shop Parameters > General "Use HTMLPurifier Library" is turned off.

This will prevent TinyMCE to remove some HTML content during validation.

If your micro-data content is still wiped, you should either apply some modifications in core during TinyMce initialisation , or (better) develop a simple module that inject your Microdata in CMS pages with Prestashop hooks.

0
HeineFR On

The TinyMCE integrated in prestashop get a lot a limited features in his configuration.

You will need to edit TinyMCe configuration in /js/admin/tinymce.inc.js