1

enter image description here

I have implemented editor on content in Admin panel and it is working fine on both frontend and backend in chrome browser, also for insert image. But insert an image in content using editor is not working in Mozilla browser. I have also provided 777 permission recursively to media folder.

Please check my below code.

Edit/Tab/Form.php
            protected function _prepareLayout()
            {
                    parent::_prepareLayout();

                    $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);

            }

           protected function _prepareForm()
           {
             $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('add_variables' => false, 'add_widgets' =>          false,'files_browser_window_url'=>$this->getBaseUrl().'admin/cms_wysiwyg_images/index/'));

                $fieldset->addField('contents', 'editor', array(
                    'name' => 'contents',
                    'label' => $this->__('Content'),
                    'title' => $this->__('Content'),
                    'style' => 'width:700px; height:300px;',
                    'config' => $wysiwygConfig,
                    'required' => true,
                    'wysiwyg' => true
                ));
        }

In layout xml:
    <default>
                <reference name="head">
                <action method="setCanLoadExtJs"><flag>1</flag></action>
                <action method="setCanLoadTinyMce"><flag>1</flag></action>
                <action method="addJs"><script>mage/adminhtml/variables.js</script></action>
                <action method="addJs"><script>mage/adminhtml/wysiwyg/widget.js</script></action>
                <action method="addJs"><script>lib/flex.js</script></action>
                <action method="addJs"><script>lib/FABridge.js</script></action>
                <action method="addJs"><script>mage/adminhtml/flexuploader.js</script></action>
                <action method="addJs"><script>mage/adminhtml/browser.js</script></action>
            [![enter image description here][1]][1]    <action method="addJs"><script>prototype/window.js</script></action>
                <action method="addJs"><script>prototype/prototype.js</script></action>
                <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
                <action method="addItem"><type>skin_css</type><file>lib/prototype/windows/themes/magento.css</file></action>
                </reference>
        </default>

Please help me to resolve this issue.

  • It's a browser issue. We have faced this issue with several additions of chrome as well. – Bill Murray Sep 23 '16 at 2:45
0

it's browser issue. we also faced this issue. you used chrome for this. it works fine in chrome browser.

| improve this answer | |
0

It doesn't look like browser issue. I have updated some more configuration on wysiwygConfig variable and it is working fine. Now final code is

  protected function _prepareForm()
  {
     $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig();

      $wysiwygConfig->addData(array(
            'add_variables'             => false,
            'plugins'                   => array(),
            'widget_window_url'         => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index'),
            'directives_url'            => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'),
            'directives_url_quoted'     => preg_quote(Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive')),
            'files_browser_window_url'  => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'),
        ));

        $fieldset->addField('contents', 'editor', array(
            'name' => 'contents',
            'label' => $this->__('Content'),
            'title' => $this->__('Content'),
            'style' => 'width:700px; height:300px;',
            'config' => $wysiwygConfig,
            'required' => true,
            'wysiwyg' => true
        ));
}

Enjoy!!!

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.