How to add WYSIWYG Editor in Magento system configuration?

MeenakshiSundaram R

I want to add WYSIWYG editor in Magento system configuration.

And also get the value from the that is there option to do this.

Cheers.

MeenakshiSundaram R

I have found the answer from this post. Thanks to Marius for giving this answer.

First of all add this in any layout file, to load the editor in the config section:

<adminhtml_system_config_edit>
    <update handle="editor"/>
    <reference name="head">
        <action method="setCanLoadTinyMce"><load>1</load></action>
    </reference>
</adminhtml_system_config_edit>

Now create your own field renderer. It has to be a block inside your module:

<?php
class Namespace_Module_Block_Adminhtml_System_Config_Editor extends Mage_Adminhtml_Block_System_Config_Form_Field implements Varien_Data_Form_Element_Renderer_Interface{
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element){
        $element->setWysiwyg(true);
        $element->setConfig(Mage::getSingleton('cms/wysiwyg_config')->getConfig());
        return parent::_getElementHtml($element);
    }
}

Now for the element inside the system.xml set the frontend_type 'editor' and the frontend_model your new block

<fieldname translate="label">
    <label>Field label </label>
    <frontend_type>editor</frontend_type>
    <frontend_model>module/adminhtml_system_config_editor</frontend_model>
    <sort_order>150</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</fieldname>

There are some issues when changing the config scope to a website or a store view. The textarea does not become 'disabled'. But if you can ignore this, you can use it without any problems.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to add WYSIWYG Editor in Magento system configuration?

From Dev

How to have default data to wysiwyg editor in magento

From Dev

User friendly WYSIWYG editor for Magento

From Dev

Magento WYSIWYG editor button not working

From Dev

How to add Kendo WYSIWYG Editor to a Kendo UI Grid Column?

From Dev

how to build an angularJS wysiwyg editor

From Dev

Magento add wysiwyg to custom frontend form

From Dev

How to insert images with my own WYSIWYG editor

From Dev

How to validate wysiwyg editor using bootstrap validation

From Dev

How to validate wysiwyg editor using bootstrap validation

From Dev

How to do background color in Froala WYSIWYG editor?

From Dev

Integrating a wysiwyg editor and how is communicating with the DB?

From Dev

Magento Backend Grid In System Configuration

From Dev

HTML5 Wysiwyg simple "Image editor" add text

From Dev

Add or replace a variation fields into a WYSIWYG editor field in Woocommerce

From Dev

magento how add dynamic url path in system.xml

From Dev

Missing wysiwyg folder in magento

From Dev

Add option to Magento system admin

From Dev

How to in-build wysiwyg editor in a self-build joomla component

From Dev

How to pass data to database using WYSIWYG HTML Javascript Editor with Django

From Dev

How to export react-froala-wysiwyg editor in an NPM module?

From Dev

Styling Wysiwyg Editor

From Dev

MFC WYSIWYG editor

From Dev

Resize images in WYSIWYG editor

From Dev

sanitization for wysiwyg editor

From Dev

Magento what is system configuration page route?

From Dev

Getting custom email template in system configuration magento?

From Dev

How to show editor in custom category attribute in magento?

From Java

Wysiwyg editor for angular4

Related Related

HotTag

Archive