How do I make textarea a TinyMCE in Joomla?

守給你的承諾、 提交于 2019-12-24 08:23:45

问题


I have a component and I want to make a textarea on the admin backend interface use the TinyMCE editor:

  1. How do I reference the TinyMCE that is being used by other components (instead of duplicating it) 2.) How do I hook into the page init or some place where I can let TinyMCE do it's magic (of if Joomla provides a way)

Thanks


回答1:


Looks like all I had to do was get an instance of JEditor and use this to render my textarea:

<?php echo $this->editor->display('name_of_your_field', 'predefined value', '100%', '400', '80', '15');?>



回答2:


<script type="text/javascript">
tinyMCE.init({
        mode : "textareas",
        theme : "simple",
        editor_selector : "mceSimple"
});

tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        editor_selector : "mceAdvanced"
});
</script>


<textarea name="product_section_table[]" class="mceAdvanced" style="width:95%">
</textarea>

If you need an advanced editor set class=mceAdvanced. If you want a simple editor then set class=mceSimple.



来源:https://stackoverflow.com/questions/2540807/how-do-i-make-textarea-a-tinymce-in-joomla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!