Does anyone know if there's some way to stop Magento "fixing" html that's added via static blocks?
For example, if I wanted to have a space within an existing menu for adding static blocks to, I wouldn't want to use a full < ul > list as it already exists, so I'd just want some additional < li > tags within the block.
However, Magento very helpfully decides to always add in the "missing" < ul > tags for you. Rather annoying.
I've tried tracing this back myself but just can't find where it's happening. I think it could be TinyMce related, as the fixing happens if you hide/show the editor, without a page refresh. I tried changing different instances I found of cleanup:1 to cleanup:0 but none of them so far worked.
Any ideas?
It's not magento that is doing this cleanup but the wysiwyg editor : tiny_mce
You can desactivate this behavior by adding :
cleanup : false
in the js config file (js/mage/adminhtml/wysiwyg/tiny_mce/setup.js)
But this is totally not recommended as it can break all of your pages is an HTML bug is injected in a block or page and you don't have any other HTML tidier on your project ...
Have a look at the tinymce configuration parameter valid_elements and valid_children.
You can define li
-tags as valid elements there and define that li
-tags may be childs to other thml nodes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With