We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1511
    • 144 Posts
    I’ve written about it twice already, two versions of TinyMCE back, but still... sad

    I’m using TinyMCE 2.0.9 in a MODx 0.95 and 0.96RC1 environment. When using it as in manager there are no problems.
    But as soon as I enter some text in the front end (say, in a NewsPublisher), there is some strange behavior.

    As soon as I press Enter, it ends a paragraph and adds a secod <p>&nbsp;</p> and then starts a new paragraph. So finally there are three paragraphs instead of only two.

    Next problem is, I cannot assign no style to elements. It is simply ignored. The contents blink a little when a new style is chosen and... nothing happens. It is the same with commands for bold, italic and others... for an instant I can see the style changes but the next moment it is the same old plain text. As if a cleansing function would do a thorough, too thorough work.

    This way the editor is useless for my users.

    On the other hand, if I edit the HTML code directly, everything is fine.

    I’m using Firefox 2.0.0.3 on XP system. I’ll try a new instance of Firefox, with no extensions, if those are a possible cause for this behavior.

    On IE7 the new paragraph (when pressing Enter) works well, but when trying to apply a "bold" style, it triggers a javascript error "Object doesn’t support this property or method" in code
    	function tvOnTinyMCEChangeCallBack(i){
    		  i.oldTargetElement.onchange();            
    	}


    Any ideas?

      • 29400
      • 15 Posts
      Quote from: andrazk at Mar 28, 2007, 10:26 AM

      As soon as I press Enter, it ends a paragraph and adds a secod <p>&nbsp;</p> and then starts a new paragraph. So finally there are three paragraphs instead of only two.

      [...]

      On IE7 the new paragraph (when pressing Enter) works well, but when trying to apply a "bold" style, it triggers a javascript error "Object doesn’t support this property or method" in code
      	function tvOnTinyMCEChangeCallBack(i){
      		  i.oldTargetElement.onchange();            
      	}


      Same problems here using Opera 9.10 and Firefox 2.0.0.3. Applying bold-style (or italics or...) does work using the keyboard shortcut. Any clicking action gives a javascript error (Firebug): [tt]i.oldTargetElement.onchange is not a function[/tt]

      MODx 0.9.6-RC2 rev 2446
      MODx 0.9.6-RC1rev 2374

      No probs with MODx 0.9.5 rev 2106

      I’ve tested in the front end, using the editor input field of the [tt]blogContent[/tt] TV.

      Any help?

      TDRWH
        • 5675
        • 120 Posts
        Quote from: andrazk

        Any ideas?

        1. Use Shift+Enter to make line break.
        2. Always use one browser’s family when you edit site content
          Автор благодарит алфавит за любезно предоставленные буквы
          • 1511
          • 144 Posts
          Soft line break works normally. But hard line break creates one extra paragraph containing just &nbsp;

          Funny thing is, in manager TinyMCE works great.

          Today tested with FF on an iMac - same results.
            • 5675
            • 120 Posts
            Make filter for *content* laugh
            It’s not recommeneded to use FF and opera with TinyMCE&FCK - not all functions are working correctly
              Автор благодарит алфавит за любезно предоставленные буквы
              • 1511
              • 144 Posts
              In my experience, read above, it doesn’t work even in IE. undecided

              BUT, it works in FF in manager, so I need to figure out what’s different.

              • Quote from: andrazk at Mar 29, 2007, 09:30 PM

                Soft line break works normally. But hard line break creates one extra paragraph containing just &nbsp;

                Funny thing is, in manager TinyMCE works great.

                Today tested with FF on an iMac - same results.
                I’m having a similar problem, although the main content editing field works OK, as do Rich Text TVs and even the QuickEdit seems to work properly. But the mod of the KoopsMailinglistX editor uses the TV Rich Text subsystem to allow it to use the default RTE, and while otherwise working great, it does the extra <p>&nbsp;</p> thing. This is also FF on Mac. Odd, that it only does this in that one situation.

                	// Get access to template variable function (to output the RTE)
                		include_once($modx->config['base_path'].'manager/includes/tmplvars.inc.php');
                	  
                		$event_output = $modx->invokeEvent("OnRichTextEditorInit", array('editor'=>$modx->config['which_editor'], 'elements'=>array('tvmailMessage')));
                	
                		if(is_array($event_output)) {
                			$editor_html = implode("",$event_output);
                		}
                		// Get HTML for the textarea, last parameters are default_value, elements, value
                		$rte_html = renderFormElement('richtext', 'mailMessage', '', '', '');
                		
                		echo $rte_html;
                		
                		echo $editor_html;
                

                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 1511
                  • 144 Posts
                  TinyMCE 2.1.0 solved my problems.
                  It works in manager as in the front end, with the callback function hack mentioned above everything is solved.

                  Could there be an option, whether or not showing the "Link list" in the front end?
                  I’m logged in as a manager but still on the web form there is no list of existing pages.
                    • 4018
                    • 1,131 Posts
                    Quote from: andrazk at Apr 03, 2007, 08:06 AM

                    TinyMCE 2.1.0 solved my problems.
                    It works in manager as in the front end, with the callback function hack mentioned above everything is solved.

                    Could there be an option, whether or not showing the "Link list" in the front end?
                    I’m logged in as a manager but still on the web form there is no list of existing pages.

                    Awesome! Good to know that the new 2.1.0 version solves some known issues! smiley

                    Regarding the "Link List" thing, I feel that the Link List feature is more of a manager only feature. Not only that, the scripts the Link List feature is using need to be locked down and secured using manager authentication. That’s just something you can’t do effectively for front-end use. So...for now, I keep it hidden except when TinyMCE is being used within the manager. Hope that answers your question.

                    Jeff
                      Jeff Whitfield

                      "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                      • 1511
                      • 144 Posts
                      On one of my MODx sites I actually perform a manager login and I do log a parallel web user and redirect it to the main page, with no manager access.
                      I’ve simply hacked a bit the tinymce.functions.php and added some conditions, so a web user can get a "Links list" but no access to the assets browser.

                      This solved my dilemmas and problems.