Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:28:34+00:00 2026-05-31T05:28:34+00:00

As you can see from the code below we, use TinyMce a lot in

  • 0

As you can see from the code below we, use TinyMce a lot in the admin area of our CMS with different options. I thought I would be able to useful the code by first overwriting the default options with $.fn.tinymce.defaults = {.

  • Am I completely wrong and this will never work?
  • Or is this another one of these tinymce restrictions and should work
    with other jquery plugins?

    $(document).ready(function() {

    // Location of TinyMCE script
    var script_url = HOME + "/webapp/shared/javascript/tiny_mce/tiny_mce_src.js";
    
    // plugin's default options
    $.fn.tinymce.defaults = {
        // Location of TinyMCE script
        script_url : script_url,
    
        // General options
        theme : "advanced",
        skin: "cirkuit",
        width: "100%",
        height: "500",
        plugins : "advhr,advimage,advlink,advlist,autolink,autosave,contextmenu,directionality,emotions,fullscreen,iespell,inlinepopups,insertdatetime,layer,lists,noneditable,nonbreaking,pagebreak,paste,preview,print,save,searchreplace,style,spellchecker,tabfocus,table,template,wordcount,visualchars,xhtmlxtras,codemagic,media",
    
        // Theme options
        body_class : "content",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "",
        theme_advanced_blockformats : "p,h2,h3,h4,h5,h6",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
    
        forced_root_block : "p",
        force_br_newlines : false,
        force_p_newlines : true,
    
        plugin_insertdate_dateFormat : "%d/%m/%Y",
        plugin_insertdate_timeFormat : "%H:%M",
        paste_auto_cleanup_on_paste : true,
        convert_urls: false,
        relative_urls: false,
    
        // Example content CSS (should be your site CSS)
        content_css : HOME+TEMPLATE_HOME+"/css/tinymce.css", //?" + new Date().getTime(),
    
        // File and Image Manager
        file_browser_callback : "openSwampyBrowser"
    }
    
    $('textarea.tinymce').tinymce({
        theme_advanced_buttons1 : "styleselect,formatselect,|,bold,italic,underline,|,bullist,numlist,|,table,|,link,unlink,|,media,image,|,template",
        theme_advanced_buttons2 : ",cut,copy,paste,pastetext,pasteword,|,selectall,undo,redo,|,hr,acronym,charmap,blockquote,|,insertdate,inserttime,|,search,|,cleanup,removeformat,|,codemagic",
    
        valid_elements : "span[class|id],br[class|id],a[href|target|title|class|id],img[src|id|width|height|class|alt],i,"+
        "li[class|id],ul[class|id],ol[class|id],p[class|id],"+
        "table[class|id],th[class|id],tr[class|id],td[class|id],thead,tbody,"+
        "h1[class|id],h2[class|id],h3[class|id],h4[class|id],h5[class|id],h6[class|id],strong[class|id],"+
        "div[class|id]",
    
        template_templates : [
          {
              title : "Paragraph Text",
              src : HOME + "/webapp/shared/javascript/tiny_mce/layouts/paragraph.tpl",
              description : "Adds HTML Paragraph Layout"
          }, {
              title : "Bullet Point List",
              src : HOME + "/webapp/shared/javascript/tiny_mce/layouts/list.tpl",
              description : "Adds HTML Paragraph Layout"
          }, {
              title : "Attribute Column",
              src : HOME + "/webapp/shared/javascript/tiny_mce/layouts/attributes.tpl",
              description : "Adds HTML Paragraph Layout, its easier to delete than add extra code."
          }
         ]
    });
    
    $('textarea.tinymce_list').tinymce({
        theme_advanced_buttons1 : "bullist,|,bold,italic,underline,|,link,unlink,|,cut,copy,paste,pastetext,pasteword,|,selectall,undo,redo,|,codemagic",
        theme_advanced_buttons2 : "",
        valid_elements : "br[class|id],a[href|target|title|class|id],i,li[class|id],ul[class|id],strong[class|id]"
    });
    
    $('textarea.tinymce_simple').tinymce({
        width: "auto",
        height: "auto",
    
        theme_advanced_buttons1 : "bold,italic,underline,|,link,unlink,|,cut,copy,paste,pastetext,pasteword,|,selectall,undo,redo",
        theme_advanced_buttons2 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_statusbar_location : "none",
        valid_elements : "br[class|id],a[href|target|title|class|id],i,strong[class|id]",
    
        // Overwrite force <p> with <br /> for new lines
        force_br_newlines : true,
        force_p_newlines : false,
        forced_root_block : ''
    });
    

    });

Original:

$(document).ready(function() {

    // Location of TinyMCE script
    var script_url = HOME + "/webapp/shared/javascript/tiny_mce/tiny_mce_src.js";

    $('textarea.tinymce').tinymce({
        // Location of TinyMCE script
        script_url : script_url,

        // General options
        theme : "advanced",
        skin: "cirkuit",
        width: "100%",
        height: "500",
        plugins : "advhr,advimage,advlink,advlist,autolink,autosave,contextmenu,directionality,emotions,fullscreen,iespell,inlinepopups,insertdatetime,layer,lists,noneditable,nonbreaking,pagebreak,paste,preview,print,save,searchreplace,style,spellchecker,tabfocus,table,template,wordcount,visualchars,xhtmlxtras,codemagic,media",

        // Theme options
        body_class : "content",
        theme_advanced_buttons1 : "styleselect,formatselect,|,bold,italic,underline,|,bullist,numlist,|,table,|,link,unlink,|,media,image,|,template",
        theme_advanced_buttons2 : ",cut,copy,paste,pastetext,pasteword,|,selectall,undo,redo,|,hr,acronym,charmap,blockquote,|,insertdate,inserttime,|,search,|,cleanup,removeformat,|,codemagic",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "",
        theme_advanced_blockformats : "p,h2,h3,h4,h5,h6",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        forced_root_block : "p",
        force_br_newlines : false,
        force_p_newlines : true,
        valid_elements : "span[class|id],br[class|id],a[href|target|title|class|id],img[src|id|width|height|class|alt],i,"+
        "li[class|id],ul[class|id],ol[class|id],p[class|id],"+
        "table[class|id],th[class|id],tr[class|id],td[class|id],thead,tbody,"+
        "h1[class|id],h2[class|id],h3[class|id],h4[class|id],h5[class|id],h6[class|id],strong[class|id],"+
        "div[class|id]",

        plugin_insertdate_dateFormat : "%d/%m/%Y",
        plugin_insertdate_timeFormat : "%H:%M",
        paste_auto_cleanup_on_paste : true,
        convert_urls: false,
        relative_urls: false,

        // Example content CSS (should be your site CSS)
        content_css : HOME+TEMPLATE_HOME+"/css/tinymce.css", //?" + new Date().getTime(),

        // File and Image Manager
        file_browser_callback : "openSwampyBrowser",

        template_templates : [
          {
              title : "Paragraph Text",
              src : HOME + "/webapp/shared/javascript/tiny_mce/layouts/paragraph.tpl",
              description : "Adds HTML Paragraph Layout"
          }, {
              title : "Bullet Point List",
              src : HOME + "/webapp/shared/javascript/tiny_mce/layouts/list.tpl",
              description : "Adds HTML Paragraph Layout"
          }, {
              title : "Attribute Column",
              src : HOME + "/webapp/shared/javascript/tiny_mce/layouts/attributes.tpl",
              description : "Adds HTML Paragraph Layout, its easier to delete than add extra code."
          }
         ]
    });

    $('textarea.tinymce_list').tinymce({
        // Location of TinyMCE script
        script_url : script_url,

        // General options
        theme : "advanced",
        skin: "cirkuit",
        width: "100%",
        plugins : "advhr,advimage,advlink,advlist,autolink,autosave,contextmenu,directionality,emotions,fullscreen,iespell,inlinepopups,insertdatetime,layer,lists,noneditable,nonbreaking,pagebreak,paste,preview,print,save,searchreplace,style,spellchecker,tabfocus,table,template,wordcount,visualchars,xhtmlxtras,codemagic,media",

        // Theme options
        theme_advanced_buttons1 : "bullist,|,bold,italic,underline,|,link,unlink,|,cut,copy,paste,pastetext,pasteword,|,selectall,undo,redo,|,codemagic",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
        valid_elements : "br[class|id],a[href|target|title|class|id],i,li[class|id],ul[class|id],strong[class|id]",

        paste_auto_cleanup_on_paste : true,
        convert_urls: false,
        relative_urls: false,

        // Example content CSS (should be your site CSS)
        content_css : HOME+TEMPLATE_HOME+"/css/tinymce.css"
    });

    $('textarea.tinymce_simple').tinymce({
        script_url : script_url,

        // General options
        theme : "advanced",
        plugins : "advhr,advimage,advlink,advlist,autolink,autosave,contextmenu,directionality,emotions,fullscreen,iespell,inlinepopups,insertdatetime,layer,lists,noneditable,nonbreaking,pagebreak,paste,preview,print,save,searchreplace,style,spellchecker,tabfocus,table,template,wordcount,visualchars,xhtmlxtras,codemagic,media",

        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,|,link,unlink,|,cut,copy,paste,pastetext,pasteword,|,selectall,undo,redo",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_buttons4 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_statusbar_location : "none",
        theme_advanced_resizing : false,
        valid_elements : "br[class|id],a[href|target|title|class|id],i,strong[class|id]",

        // Force <br /> new lines
        force_br_newlines : true,
        force_p_newlines : false,
        forced_root_block : '',

        paste_auto_cleanup_on_paste : true,
        convert_urls: false,
        relative_urls: false,

        // Example content CSS (should be your site CSS)
        content_css : HOME+TEMPLATE_HOME+"/css/tinymce.css"
    });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:28:35+00:00Added an answer on May 31, 2026 at 5:28 am

    My solution work with a basic tinymce config object and each instance adds its special settings to it. This way i only need to define the additional setting for each instance and not all settings:

    var tiny_mce_global_config = {
    
    script_url : '/js/tiny_mce/tiny_mce.js',
    
    // General options
    theme : "advanced",
    plugins : "contextmenu, nonbreaking, advlist, searchreplace, tabfocus, wordcount",
    dialog_type : "modal", 
    
    // Theme options
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : false,
    
    gecko_spellcheck: true,
    
    button_tile_map: true,
    ...
    };
    
    var config_tinymce_dynamic1 = {
        language : 'de',
        content_css : "mycontent.css",
            editor_css : 'editor.css',
    
        width: "800",
        height: "40",
    
        theme_advanced_buttons1 : "code",
        theme_advanced_buttons2 : "",
    ...
    };
    
    $(document).ready(function(){
    
            init_obj = {element_id:'dynamic1', window: window};
            $.extend(true, config_tinymce_dynamic1, tiny_mce_global_config);
            $.extend(true, init_obj, config_tinymce_dynamic1);
            tinyMCE.execCommand('mceAddFrameControl',false, init_obj); 
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some really funky code. As you can see from the code below
I'm have this code below. As you can see I'm trying to use the
As you can see this is a question from a non web developer. I
How can I create a Popup balloon like you would see from Windows Messenger
How can I remove the animation from this jQuery modal window? You can see
While HTML Scraping is pretty well-documented from what I can see, and I understand
From a security perspective, I can see simply doing an 'eval' on incoming JSON
From http://developer.yahoo.com/yui/docs/YAHOO.util.DataSourceBase.html#method_sendRequest , you can see the oCallback is an object literal with the
I'm making this method retrieve records from the Data Base. As you can see
Say a table has several subclass types. How can I see all columns from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.