1

Topic: "Bug" with multiple instances on one page

Both editors work and show up, however, when using the "pop ups" on the first instance, i.e. link, html, etc., they do not work.  They appear but it has the text from the other instance and it says "{#advanced_dlg.code_title} {#advanced_dlg.code_wordwrap}".

I am assuming it is a simple fix...however I searched and could not see the solution.

Any help would be appreciated.

Thanks!

Here is my code -

Instance #1:

<!-- TinyMCE -->
<script type="text/javascript" src="/scripts/tiny_mce/tiny_mce_gzip.js"></script>
<script type="text/javascript">
// This is where the compressor will load all components, include all components used on the page here
tinyMCE_GZ.init({
    plugins : "safari,layer,table,advhr,advimage,advlink,inlinepopups,media,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
    themes : 'advanced',
    languages : 'en',
    disk_cache : true,
    debug : false
},function () {
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        editor_selector : "mceEditor",
        plugins : "safari,layer,table,advhr,advimage,advlink,inlinepopups,media,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,advhr,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        extended_valid_elements : 'iframe[class|frameborder|height|width|id|name|class|scrolling|src|title]'
        });
});
</script>
<!-- /TinyMCE -->

Instance #2:

<script type="text/javascript" src="/scripts/tiny_mce/tiny_mce_gzip.js"></script>
<script type="text/javascript">
var selector = 'custom_module';
// This is where the compressor will load all components, include all components used on the page here

tinyMCE_GZ.init({
    plugins : "safari,layer,table,advhr,advimage,advlink,inlinepopups,media,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
    themes : 'advanced',
    languages : 'en',
    disk_cache : true,
    debug : false
},function () {
    tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        editor_selector : selector,
        plugins : "advimage,advlink,inlinepopups,media,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,bullist,numlist,|,outdent,indent,blockquote,|,forecolor",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,undo,redo,|,link,unlink,image,cleanup,code",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_resizing : true
        });
});
</script>
<!-- /TinyMCE -->

2

Re: "Bug" with multiple instances on one page

You are using mode textareas (means all textareas) twice --> http://wiki.moxiecode.com/index.php/Tin … ation/mode
If you want to use editor_selector you need to use a different mode.

3

Re: "Bug" with multiple instances on one page

Thanks, I don't think that was it.  I change the mode to 'mode : "specific_textareas"' on both and the same thing happens.  I tried exact, and even removing "mode", but still doesn't work.

The only thing I can think of is it is a problem with the gzip and would not have a problem if not using that.

4

Re: "Bug" with multiple instances on one page

Can anyone tell me why when having both sets of code on the page everything works except for anything that requires "pop ups/modal windows"?

5

Re: "Bug" with multiple instances on one page

Hard to say if you can't provide a test site or more code. Maybe you're doing something wrong like not having id's on the textareas?

6

Re: "Bug" with multiple instances on one page

Ok...I am back to this issue.  I thought I would avoid it all together, but it resurfaced.

Back to the situation.  I have the advanced theme included on the page twice.  The first instance has just about all of the features.  The second instance has more features than simple, but it still uses the advanced theme.

Both instances use the editor selector flag and work (i.e. they show up, you can click on bold, etc).  The only problem is that when you click on "HTML" in the first editor you get all of the text as "{#advlink_dlg.general_props}".  Also in the "HTML" code instead of showing the code from that editor, it shows the code from another editor on the page (but only in this pop-up).

If you click on the "HTML" button in the second editor it loads correctly and it shows the correct content.  If you then go back to the first instance and click on "HTML" the "{#advlink_dlg.general_props}" is now replaced with the correct translated text, but still contains the content from the other editor.

All of the code from the page is above.  My guess is that you cannot have the advanced theme used twice on one page with different buttons per textarea.  I might see about modifying the simple theme to include the features I wanted from advanced.

Thanks for the help.

7

Re: "Bug" with multiple instances on one page

I also went back and looked at the examples and there is not an example with 1 theme for multiple instances with instances having different buttons.

There is an example showing one instance using simple and the other instance using advanced.  I believe the problem is that you cannot have the same theme on one page with different buttons.

8

Re: "Bug" with multiple instances on one page

I set up a simple test case --> http://crowded.se/test/atest.php
I cannot reproduce your case so it must be something wrong on your end.

9

Re: "Bug" with multiple instances on one page

My situation uses the "inline" modal windows which might behave differently than the pop-up separate windows and I am also using the gzip system as well.

It is quite possible that I could have something off.  I did just enable all features on the "second" instance.  The primary reason why I wanted a cut down version was due to space, but the editor "floats" and doesn't blow out the div the smaller instance is in.