We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26113
    • 88 Posts
    I’m running modx version 0.9.6
    I’ve setup a template variable using the TinyMCE widget.
    In the plugin configuration I have it set to custom.
    In a page, I place the placeholder variable [*editor*] in to the content area so the editor will load in that page.

    The editor loads fine on the page and all buttons present. However when I click the image button in the editor button bar, the image browse button is not present.

    Why is this?
    Thanks
    Rich
      • 26113
      • 88 Posts
      Quote from: sandman at Aug 20, 2007, 08:16 PM

      I’m running modx version 0.9.6
      I’ve setup a template variable using the TinyMCE widget.
      In the plugin configuration I have it set to custom.
      In a page, I place the placeholder variable [*editor*] in to the content area so the editor will load in that page.

      The editor loads fine on the page and all buttons present. However when I click the image button in the editor button bar, the image browse button is not present.

      Why is this?
      Thanks
      Rich

      I was looking at the scripts generated for TinyMCE, and notice a few lines in the javascript are missing which seem to generate the image browser:
      <script language="javascript" type="text/javascript">
      	tinyMCE.init({
      		  theme : "advanced",
      		  mode : "exact",
      		  width : "100%",
      		  height : "400px",
      		  relative_urls : true,
      		  document_base_url : "/",
      		  remove_script_host : true,
      		  language : "en",
      		  elements : "ta",
      		  valid_elements : tinymce_valid_elements,
      		  extended_valid_elements : tinymce_extended_valid_elements,
      		  invalid_elements : tinymce_invalid_elements,
      		  entity_encoding : "named",
      		  cleanup: true,
      		  apply_source_formatting : true,
      		  remove_linebreaks : false,
      		  convert_fonts_to_spans : "true",
      		  onchange_callback : "tvOnTinyMCEChangeCallBack",
      		  resource_browser_path : "/manager/media/browser/mcpuk/browser.html?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/",
      		  file_browser_callback : "fileBrowserCallBack",
      		  theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6,div,blockquote,code,pre,address",
      		  plugins : "style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media",
      		  theme_advanced_buttons0 : "",
      		  theme_advanced_buttons1 : "undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,print,code,help",
      		  theme_advanced_buttons2 : "bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect,separator,styleprops",
      		  theme_advanced_buttons3 : "",
      		  theme_advanced_buttons4 : "",
      		  theme_advanced_toolbar_location : "top",
      		  theme_advanced_toolbar_align : "left",
      		  theme_advanced_path_location : "bottom",
      		  theme_advanced_disable : "",
      		  theme_advanced_resizing : false,
      		  theme_advanced_resize_horizontal : false,
      		  plugin_insertdate_dateFormat : "%Y-%m-%d",
      		  plugin_insertdate_timeFormat : "%H:%M:%S",
      		  button_tile_map : false 
      
      	});
      	function fileBrowserCallBack(field_name, url, type, win) {
      		// This is where you insert your custom filebrowser logic
      		var win=tinyMCE.getWindowArg("window");
      		win.BrowseServer(field_name);
      	}
        function tvOnTinyMCEChangeCallBack(i){
          if (i.oldTargetElement.onchange) {
            i.oldTargetElement.onchange();
          }
        }	
      </script>


      The following lines are not written out when I use the TV method in a page:
      resource_browser_path : "/manager/media/browser/mcpuk/browser.html?Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/",
      		  file_browser_callback : "fileBrowserCallBack",
      


      Any ideas how I can get this to load? Has anyone else use TinyMCE in your pages? What method did you use?
      Thanks
      Rich