We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6470
    • 69 Posts
    howto disable TinyMCE for backend but leave it for frontend

    TinyMCE tend to reformating content fields in backend and so i need it do disable but
    It is absolutely required in front end with advanced schema.

    Is it possible to fix a script or whatever to make it check if it Front end[allow] if not skip???
      • 4018
      • 1,131 Posts
      Right now...you can’t. I’m sure there is a way to do it with a plugin but nothing built-in...that would require some hacking. We’ll put this in as a feature request and will see if we can bundle it in. Would be nice to be able to set access rights to individual plugins. smiley

      Jeff
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
        • 27889
        • 415 Posts
        Right but if you want, you can disable it in manager and add the script call in your page for front end use.
          MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
          MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
          • 6470
          • 69 Posts
          It is a good idea
          I tryed to copy part of the plugin(mce] to a snippet an call it in a page
          but no results

          include_once $modx->config['base_path'].'assets/plugins/tinymce2111/tinymce.lang.php';
          include_once $modx->config['base_path'].'assets/plugins/tinymce2111/tinymce.functions.php';
          
          if(!isset($tinyPath)) { 
          	global $tinyPath;
          	$tinyPath = $modx->config['base_path'].'assets/plugins/tinymce2111'; 
          }
          $base_url = $modx->config['base_url'];
          $displayStyle = ( ($_SESSION['browser']=='mz') || ($_SESSION['browser']=='op') ) ? "table-row" : "block" ;
          
          
          
          if(isset($forfrontend)||$modx->isFrontend()){
          				$frontend = 'true';
          				$frontend_language = isset($modx->config['fe_editor_lang']) ? $modx->config['fe_editor_lang']:"";
          				$tinymce_language = getTinyMCELang($frontend_language);
          				$html = getTinyMCEScript($elementList,$webtheme,$width,$height,$tinymce_language,$frontend,$base_url, $webPlugins, $webButtons1, $webButtons2, $webButtons3, $webButtons4, $disabledButtons, $tinyFormats, $entity_encoding, $entities, $tinyPathOptions, $tinyCleanup, $tinyResizing, $modx->config['editor_css_path'], $modx->config['tinymce_css_selectors'], $modx->config['use_browser'], $webAlign, null, null, $tinyLinkList);
          			} 
            • 4018
            • 1,131 Posts
            That’s not gonna work. Reason is that the scripts are expecting very specific parameters for the getTinyMCEScript call that are not present unless it is ran as a plugin. I think there was someone who posted a script for creating a TinyMCE call somewhere...just need to look. If I find it I’ll post the link back here. Else...well...I’ll play around with some scripts and see what I can come up with. smiley

            Jeff
              Jeff Whitfield

              "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
              • 6470
              • 69 Posts
              Thanx

              I hope you find a solution
                • 27889
                • 415 Posts
                I would talk about a "normal" call like this:

                <script language="javascript" type="text/javascript" src="assets/plugins/tinymce2111/jscripts/tiny_mce/tiny_mce.js"></script>
                <script language="javascript" type="text/javascript">
                
                //your configuration detail check http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
                tinyMCE.init({
                	theme : "advanced",
                	mode : "exact",
                	elements : "idtextarea"
                });
                </script>
                


                I don’t know if the bundled tinyMce will work, but if you don’t use it in the manager, you can use the normal package (in an other dir) and call it.
                  MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                  MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                  • 6470
                  • 69 Posts
                  unfortinatily
                  it did’t work
                  and I am not so good at scripting.

                  Pity...