Magento – How to add a (working) widget button to category WYSIWYG editors

backendcategorymagento-1.7widgetswysiwyg

I need to add the widget button to the WYSIWYG editors of some category attributes.

There are two questions on Stack Overflow with accepted answers:

The one problem: this solution doesn't work 100% (tested on EE 1.12.0.2 and CE 1.7.0.2).

What's the problem?

If you set the config entry add_widgets to true (btw, you can do that by observing the event cms_wysiwyg_config_prepare, that's better than rewriting or overwriting the helper block), the widget buttons are displayed. That's fine.

You can even use the "Insert Widget…" button outside the WYSIWYG Editor. That's good.

The problem is the widget button in the WYSIWYG editor: you can click on it, the widget manager opens but when you select a widget type, the configuration area doesn't open.

That's the button not working

Empty configuration page

The reason is that there is a JavaScript error happening:

"HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy"

Javascript Error

Even after debugging for some time I didn't find out how this can be fixed. Did somebody of you already solve that problem?

Best Answer

@Matthias,

I have created this module for you.

This works for me!

https://github.com/mkdizajn/hairy-tribble

cheers