1

I'm struggling with adding html code to cms blocks and pages via the WYSIWYG editor in Magento 2.1.x(10).

In WYSIWYG editor of cms block I enter:

<div class="classname" data-url='{{store url="about-us"}}'>

Click "SAVE", and what I get is:

<div class="classname" data-url="{{store url=&quot;about-us&quot;}}">

I also tried with adding a href tag. Tried with all combinations of braces. It keeps stripping my html code on Save. I don't need that.

I read Alan Storm's article on this topic. Read a few questions with no definitive answers on how to fix this around here on the magento stackexchange.

Weighing on the benefits of having tinyMCE keep my html code in WYSIWYG editor in check vs being able to easily add links and images to html elements in my cms pages and blocks, I decide in favor of the latter.

I want to disable tinyMCE altogether. How can I do that?

2
  • actually it does this on loading I think and when you save it again, your html is messed up. Yes, really annoying. I'm not sure how to disable it right now, but did you try this: <div class="classname" data-url="{{store url='about-us'}}"> already? That way worked for us mostly – David Verholen Nov 23 '17 at 19:07
  • Oddly, this time that one stuck, without being messed up. However, what I actually need is to place a href tag. <a href="{{store url='about-us'}}">Link</a> The a href gets completely stripped out on Save. :( Is there an easy way..? – Iveta Allogenes Nov 23 '17 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.