• Support/Comments for TinyMCE#

  • Bravado Reply #1, 5 years, 10 months ago

    Reply
    This is an auto-generated support/comment thread for TinyMCE.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Adds the TinyMCE richtext editor to MODx.


  • Duane Reply #2, 5 years, 10 months ago

    Reply
    I have a series of product pages where the product is shown as a thumbnail and uses lightbox-plus to open a larger view.

    Whenever I do any editing on this page, the lightbox effect disappears, and after some experimenting I have determined it's because MCE is stripping the rel="lightbox" call out of the <a> tag.

    If I try to re-insert the rel="lightbox" in the HTML code view of MCE, it doesn't save it. In fact, the only way I can get the rel="lightbox" back into the <a> tag is to manually insert it into the database with PHP MyAdmin.

    Why is this happening? Is there some setting that strips tag properties not generated by the image insertion function?

    I can't find anything about this at MoxieCode, so I was hoping someone here would know.

    Thanks,
    Duane


  • doze Reply #3, 5 years, 10 months ago

    Reply
    Maybe need to edit the valid_elemets configuration setting to allow rel attribute in link tags. But I'm sure you can save the rel attribute from manager if you just disable the editor for that document (in the "page settings" tab, "rich text" checkbox).


  • Bravado Reply #4, 5 years, 10 months ago

    Reply
    Doze, you pretty much have it right on the money. However, rather than using the valid_elements config setting, I think the extended_valid_elements config setting should be used instead. If you look at the plugin code, you'll see a line like this:

    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]",


    It's pretty easy to figure out what's what on this line. To add support for the "rel" attribute for "a" tags, you could simply add in the "rel" attribute to the the part of the line dealing with anchor tags (a[name|href|target|title|onclick|rel]). Just modify the code like that and you should be set.

    Probably what I'll do for the next revision is add in the valid_elements config setting to where just about every valid element in the XHTML specification is covered. That way we won't have a bunch of elements constantly being replaced on users.

    More to come....

    Jeff


  • Duane Reply #5, 5 years, 10 months ago

    Reply
    Quote from: Bravado at Jul 11, 2006, 10:35 AM
    Doze, you pretty much have it right on the money. However, rather than using the valid_elements config setting, I think the extended_valid_elements config setting should be used instead. If you look at the plugin code, you'll see a line like this:

    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]",


    It's pretty easy to figure out what's what on this line. To add support for the "rel" attribute for "a" tags, you could simply add in the "rel" attribute to the the part of the line dealing with anchor tags (a[name|href|target|title|onclick|rel]). Just modify the code like that and you should be set.

    Probably what I'll do for the next revision is add in the valid_elements config setting to where just about every valid element in the XHTML specification is covered. That way we won't have a bunch of elements constantly being replaced on users.

    More to come....

    Jeff

    This worked perfectly! Thank you.

    Duane


  • yama Reply #6, 5 years, 10 months ago

    Reply
    http://modxcms.com/forums/index.php/topic,4910.0.html
    Japanese lang files is here.

    If this file doesn't exist, the following errors might be displayed. (at japanese-euc)



  • Bravado Reply #7, 5 years, 10 months ago

    Reply
    One step ahead of ya, Yama! I've added the Japanese language file. I just need to test it right quick and update the current version in the repository.


  • Marschant Reply #8, 5 years, 10 months ago

    Reply
    Last night I upgraded to tinymce 2.0.6.1 from 2.0.4 and now the element path is no longer working, here's my init call:

    		$fullScript = <<<FULL_SCRIPT
    <script language="javascript" type="text/javascript" src="{$base_url}assets/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
    <script language="javascript" type="text/javascript">
    	tinyMCE.init({
    		  theme : "advanced",
    		  mode : "exact",
    		  relative_urls : {$relative_urls}, {$document_base_url}
    		  remove_script_host : {$remove_script_host},
    		  language : "{$tinymce_language}",
    		  nowrap : false,
                      object_resizing : false,
                      fix_content_duplication : true,
                      force_p_newlines : false,
                      force_br_newlines : false,
                      remove_linebreaks : false,
                      apply_source_formatting : false,
                      fix_list_elements : true,
    		  $elmList
    		  $webWidth
    		  $webHeight
    		  plugins : "style,layer,table,advhr,advimage,advlink,insertdatetime,preview,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",
    		  theme_advanced_buttons1_add_before : "separator,save,newdocument,separator",
    		  theme_advanced_buttons1_add : "",
    		  theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
    		  theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator,pastetext,pasteword,selectall,separator",
    		  theme_advanced_buttons3_add_before: "tablecontrols,separator",
    		  theme_advanced_buttons3_add : "iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
    		  theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops",
    		  theme_advanced_toolbar_location : "bottom",
    		  theme_advanced_toolbar_align : "left",
    		  theme_advanced_path_location : "top",
                      theme_advanced_source_editor_width : "768",
                      theme_advanced_source_editor_height : "576",
                      theme_advanced_source_editor_wrap : true,
    		  plugin_insertdate_dateFormat : "%Y-%m-%d",
    		  plugin_insertdate_timeFormat : "%H:%M:%S",
    		  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]",
    		  $cssPath
    		  $cssSelector
    		  onchange_callback : "tvOnTinyMCEChangeCallBack",
    		  resource_browser_path : "{$base_url}manager/media/browser/mcpuk/browser.html?Connector={$base_url}manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath={$base_url}",
    		  $fileBrowserCallback
    	   });


    Anybody else experienced this or know of a way to correct this?


  • Bravado Reply #9, 5 years, 10 months ago

    Reply
    Element path? I'm not sure what you mean. Could you post the HTML code from an instance of TinyMCE after rendering? The code might look like this:

    <script language="javascript" type="text/javascript" src="/assets/plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
    <script language="javascript" type="text/javascript">
    	tinyMCE.init({
    		  theme : "advanced",
    		  mode : "exact",
    		  relative_urls : true,
    		  document_base_url : "/",
    		  remove_script_host : true,
    		  language : "en",
    		  elements : "ta,tvhi_sidebar",
    		  
    		  
    		  plugins : "style,layer,table,advhr,advimage,advlink,emotions,insertdatetime,preview,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable",
    		  theme_advanced_buttons1_add_before : "save,newdocument,separator",
    		  theme_advanced_buttons1_add : "fontselect,fontsizeselect",
    		  theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
    		  theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator,pastetext,pasteword,selectall,separator",
    		  theme_advanced_buttons3_add_before: "tablecontrols,separator",
    		  theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
    		  theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops",
    		  theme_advanced_toolbar_location : "top",
    		  theme_advanced_toolbar_align : "left",
    		  theme_advanced_path_location : "bottom",
    		  plugin_insertdate_dateFormat : "%Y-%m-%d",
    		  plugin_insertdate_timeFormat : "%H:%M:%S",
    		  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]",
    		  
    		  
    		  preformatted : 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"
    	   });
    	
    	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){
    		  i.oldTargetElement.onchange();            
    	}
    </script>


    This will help me get a better idea how it's being parsed on your end. Thanks!


  • Marschant Reply #10, 5 years, 10 months ago

    Reply
    Basically it's the block the display the html structure of the content i.e. path block shows div > p when you have a paragraph within a div selected. I disabled the new layer plugin as well as some others that I didn't need and all of a sudden the path displayed correctly. Very weird....