回答
首先添加這個在任何佈局文件,加載在配置部分編輯:
<adminhtml_system_config_edit>
<update handle="editor"/>
<reference name="head">
<action method="setCanLoadTinyMce"><load>1</load></action>
</reference>
</adminhtml_system_config_edit>
現在,創建自己的場渲染。它必須是你的模塊裏面的模塊:
<?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);
}
}
現在對於設置frontend_type「編輯」對System.Xml內的元素和frontend_model新塊
<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>
有一些問題時,將配置範圍更改爲網站或商店視圖。 textarea不會變成「禁用」。但是,如果你可以忽略這一點,你可以毫無問題地使用它。
很好的描述,但對於像我這樣的magento初學者來說很簡短。下載此示例並編輯它作爲Meenakshi說100%的工作解決方案:http://www.junaidbhura.com/add-color-picker-magento-admin-anywhere/ –
好答案@meenakshi –
你需要做的是添加一個所見即所得的編輯器及其相應的adminhtml控制器。在此之後,您可以爲您指定的每個配置字段加載編輯器。
嘗試閱讀this article。這是如何添加編輯器的分步指南。
一個鏈接是不是一個答案:請編輯你的答案來描述什麼是必要的步驟,離開鏈接以供參考 – OSdave
@richardbernards以上鍊接引用是爲管理員添加所見即所得編輯器的形式。我想添加在系統配置 –
該系統配置是一個大的管理形式;) – RichardBernards
- 1. PyroCMS - 在前端添加WYSIWYG編輯器
- 2. Magento wysiwyg編輯器在phtml文件
- 3. 如何在Wordpress元框中添加wysiwyg編輯器
- 4. 如何在火狐模塊中添加wysiwyg編輯器
- 5. 如何在「HTML」火拼組件中添加wysiwyg編輯器
- 6. 添加wysiwyg編輯器成功插入magento的圖像1.5.2
- 7. jhtmlarea wysiwyg編輯器 - 添加表格
- 8. Magento的WYSIWYG編輯器輸入丟失
- 9. 如何以編程方式Magento的WYSIWYG編輯器
- 10. 在系統配置添加自定義字段在Magento 2
- 11. 在wysiwyg編輯器中添加onclick事件到html元素中
- 12. 如何將Kendo WYSIWYG編輯器添加到Kendo UI網格列?
- 13. 如何添加一個新行到textAngular WYSIWYG編輯器
- 14. Bolt CMS:在編輯器/ wysiwyg中添加條目/塊
- 15. 在WordPress textarea Meta Box中添加wysiwyg編輯器
- 16. 爲WYSIWYG編輯器
- 17. Wysiwyg編輯器angular4
- 18. 如何禁用/啓用Magento的WYSIWYG編輯器1.4
- 19. Magento - 將WYSIWYG編輯器添加到自定義小部件選項
- 20. 添加功能daviferreira的WYSIWYG編輯器中
- 21. 如何使用wysiwyg編輯器?
- 22. Magento後端網格在系統配置
- 23. wysiwyg contenteditable編輯器 - 如何設置富文本編輯器的最大長度
- 24. 在wysiwyg編輯器中可拖拽
- 25. 在WYSIWYG編輯器中插入圖像
- 26. 編輯HTML與WYSIWYG編輯器
- 27. 如何在配置文件中添加spring編輯
- 28. 如何在magento中添加評論有用的投票系統?
- 29. Wysiwyg編輯器帶導軌
- 30. Lightweight Rails 3 WYSIWYG編輯器
您可以使用[This](http://magento.stackexchange.com/questions/1569/how-to-add-wysiwyg-functionality-to-magento-config-items)鏈接在您的配置中添加wysiwyg編輯器領域。 – Zaheerabbas