Google adsense JS ads are not working in TinyMCE editor?

4 posts by 3 authors in: Forums > CMS Builder
Last Post: September 4, 2019   (RSS)

By daniel - August 16, 2019

Hi Vishal,

There's no easy way to override the HTML formatting that happens in the WYSIWYG fields, though in general, they're not ideal for inserting things like JavaScript. My recommendation would be to add a new text field or text box specifically for this adsense code. Text fields and text boxes should both keep your JS intact.

Let me know if you have any other questions!

Thanks,

Daniel
Technical Lead
interactivetools.com

By (Deleted User) - August 18, 2019

How can I do this ?

By moh3 - September 4, 2019 - edited: September 4, 2019

You need to add a wysiwyg_custom.php

and add the following option in tinymce init function

extended_valid_elements:"body[style|script|iframe],"
+"p[script|div|p|br|span|img|style|h1|h2|h3|h4|h5|iframe|hr|class],"
+"div[script|p|br|span|img|style|h1|h2|h3|h4|h5|iframe|i|hr|class],"
+"iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src|id|class|title|style|allowfullscreen],"
+"span[h1|h2|img|i|data|style|class],"
+"i[h1|h2|img|span|data|style|class],"
+"javascript[src|async],"
+"ins[class|style|data],"
+"img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style|placeholder_data]",
valid_children:"+body[style|script|iframe],"
+"+p[script|div|p|br|span|img|style|h1|h2|h3|h4|h5|iframe|hr|class],"
+"+div[script|p|br|span|img|style|h1|h2|h3|h4|h5|iframe|i|div|hr|class],"
+"+iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src|id|class|title|style|allowfullscreen],"
+"+span[h1|h2|img|i|data|style|class],"
+"i[h1|h2|img|span|data|style|class],"
+"javascript[src|async],"
+"ins[class|style|data],"
+"+img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style|placeholder_data]",