将CK编辑器集成到自定义Joomla组件中的麻烦

时间:2011-07-13 23:52:24

标签: joomla components ckeditor

以下是自定义组件页面中的代码。在Joomla之外,显示CKEditor,但在Joomla中,它只显示默认的textarea。请帮忙! >

<fieldset>
    <legend>System Text</legend>
    <select name="txtid">
    <option value="">Change Page</option>
    <option value="1">Homepage Steps</option>
    </select>
    <h2>Setting 1</h2>
<p>

    <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
</p>
    <script type="text/javascript">
    //<![CDATA[

        // Replace the <textarea id="editor"> with an CKEditor
        // instance, using default configurations.
        CKEDITOR.replace( 'editor2',
            {
                extraPlugins : 'uicolor',
                uiColor: '#14B8C4',
                toolbar :
                [
                    [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                    [ 'UIColor' ]
                ]
            } );

    //]]>
    </script>
</fieldset>

&GT;

2 个答案:

答案 0 :(得分:0)

这是我使用的:

  $editor =& JFactory::getEditor();
  $editor_params = array('theme' => 'simple');
  echo $editor->display('htmlDescription',$htmlDescr , '100%', '250', '50', '15', 'false', $editor_params);

答案 1 :(得分:0)

$editor      =& JFactory::getEditor();                                        
echo $editor->display('desc',"content in textarea" ,'50%', '300px', '75', '20', false); 
相关问题