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.

1
  • It's a browser issue. We have faced this issue with several additions of chrome as well. Commented Sep 23, 2016 at 2:45

2 Answers 2

0

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

4
  • You can explain more details? Commented Sep 23, 2016 at 4:37
  • it's not because of any code missing. sometimes its happen with some browser so use use chrome browser. Commented Sep 23, 2016 at 4:42
  • @jigsparmar : chat.stackexchange.com/rooms/45747/…
    – Gem
    Commented Sep 23, 2016 at 5:25
  • i need your help
    – Gem
    Commented Sep 23, 2016 at 5:25
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!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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