0
votes

What I want is to insert TinyMce wysiwyg editor onto frontend. Currently what I have is: on frontpage by button click ajax request loads textarea with tinymce.init script. tiny_mce.js file is loaded into head. When I open editable textarea I am able to write something, BUT what I in html structure is something like

false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false > false And so on and so forth.

UPDATE 1

The problem is: I need wysiwyg on frontend. I'v added tiny_mce.js to frontend, and run init. But it doesn't work properly somewhy. Buttons don't work, and if I enter the text, no html created. So I always get false false false in html nodes.

UPDATE 2 My current tinymce config is following. I am able to display WYSIWYG editor window. Moreover I can get uploader window, without magento's file selection.

    <script language="javascript" type="text/javascript">
    //NB: the single quotes for the doctype param must be backslashed; wiki format is removing them.
    // Event.observe(window, 'load', function() {
        tinyMCE.init({
            mode : "exact",
            theme : "advanced",
            strict_loading_mode : true, 
            elements : "block_content",
            plugins : "preview,media,iespell,insertdatetime,advimage,advlink,emotions,table,save,advhr,style,layer,inlinepopups,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",        
            theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_path_location : "bottom",        
            theme_advanced_resize_horizontal : "true",
            theme_advanced_resizing : "true",
            apply_source_formatting : "true",
            convert_urls : "false",
            doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',

            force_p_newlines : 'false',
            force_br_newlines : 'true',
            forced_root_block : 'false',             //btw, I still get <p> tags if this is false
            remove_trailing_nbsp : 'false',
            verify_html : false,
            extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style],tr"        
        });  
    // });

    </script>
1
sorry, i do not understand what your problem is hereThariama

1 Answers

2
votes

OK. I think I Found the problem with false.

forced_root_block : 'false'

tells tinyMce to wrap elements into false.