开发者

How to Disable/Enable WYSIWYG editor in Magento 1.4

开发者 https://www.devze.com 2022-12-29 16:48 出处:网络
When entering code in CMS static block(possible page as well) and in this code there is empty DIV tags such us:

When entering code in CMS static block(possible page as well) and in this code there is empty DIV tags such us:

       <a href="javascript:hide1(),show2(),hide3()"><div class="dropoff_button"></div></a>    

The DIV tags will be gone next time you open the block to edit. it will look as this

       <a href="javascript:hide1(),show2(),hide3()">  </a>     without the div tags  

...and saving again it modifies your code.

I think it something to do with the 'show/hide editor'. By default it goes into the WYSIWYG editor, so when updating static block i don't se开发者_运维百科e any other solution than 1."hide the editor' by clicking 'show/hide editor' 2.delete the old code from the editor 3. get code that doesn't miss the DIVs 4. Merge new code with code in 3 in some other editing software than magento 5. paste result in the magento editor, 6. Save

Is this bug? What is your solution? Can i turn of WYSIWYG editor?


This may not be consider as an answer but it solved our problem. It turns out that the editor WYSIWYG can be disabled by completely or by default at Admin->System->Configuration. Under 'General Tab' there is 'Content Management' section and there you can set different modes for this editor.

In our case we set to "Disable by Default" so that any time we open static block it does not clean the code only if we choose by clicking "Show/Hide Editor"


The editor, whether in WYSIWYG or not, tries to clean up your code. You may notice that it also replaces all your newlines and indentation as well. This means that you cannot just freely enter HTML into the CMS editor w/o it interfering.

I have not found a simple way to trigger the CMS not to clean your code on the way into the database.

Hope that helps. Thanks, Joe


You can allow specific tags into tinymce. You just need to edit the settings var in /js/mage/adminhtml/wysiwyg/tiny_mce/setup.js and add the following line:

extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|allowTransparency],style,script',

You can see more info about it at this other thread: Magento - How to allow certain tags (iframe, embed) in Magento's CMS editor?

It works for me on Magento 1.6.

0

精彩评论

暂无评论...
验证码 换一张
取 消