4

I added a <div> inside of an <a> in Magento CMS editor. Later it disappeared.

In Magento HTML editor, how do I add <div> inside <a> Hopefully it won't disappear, and it produces proper output.

MeenakshiSundaram R
  • 2,837
  • 3
  • 29
  • 41
vinothavn
  • 547
  • 1
  • 5
  • 19

2 Answers2

3

You need to turn off the WYSIWYG editor.

In your Magento admin, go to System->Configuration->General->Content Management->WYSIWYG Options and disable it by default.

If that doesn't work, most likely the CMS editor is sanitizing the input to prevent code execution and injections in situations where that content would be edited at a sub-Administrator access level.

If that's the case, then it's an important security feature, and you'll have to edit templates directly to get the results you want.

You can find template files in:

/path/to/magento/app/design/frontend/<package>/<theme>/template/

And you can get help identifying which template files are being loaded by going to System->Configuration->Advanced->Developer, selecting your store view from the dropdown on the top-left of the page, then setting the three fields under Debug to Yes

Adelmar
  • 2,073
  • 2
  • 20
  • 20
3

please don't insert <a> tag inside the <div>. Better add the properties of <div> to the <a> tag itself. Try this, it will work.

MeenakshiSundaram R
  • 2,837
  • 3
  • 29
  • 41
Prabhu
  • 840
  • 11
  • 28
  • It is best to create HTML that conforms to the standards. Purposefully breaking the standards reflects poorly on your competency as a web designer and will at some future date cause you a lot of grief. – Fiasco Labs Oct 05 '13 at 19:25