We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36905
    • 9 Posts
    I'm looking for anyone who can help here... I'm currently integrating elRTE with elFinder into MODx for one of my sites and stumbled across an issue.

    Using the Ext.onReady method, I can load and use elRTE without any problems. But only in Revolution 2.2.0 RC 1. In Revolution 2.1.1 the method is called/triggered too soon.

    When using MODx.on('ready'... the editor loads in both versions, however when attempting to load the CSS for the editor I get the interesting error of:
    Resource interpreted as Other but transferred with MIME type undefined.
    from the javascript console. Which, with a little research, is an issue with the server sending a Javascript HTTP response request.

    Is there a MODx event that is triggered after the resource content textarea is loaded?
      • 3749
      • 24,544 Posts
      I think OnWebPagePrerender is the last event that fires before the page is sent to the browser.

      OnParseDocument fires earlier -- before any tags are processed.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • That is a project I would be very interested in following; I've integrated elFinder in the front-end, but haven't figured out the Revo back-end enough to be able to start on something like that.
          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
          • 36905
          • 9 Posts
          I managed to solve it without using the OnWebPagePrerender or OnWebPageRender (I couldn't get them to fire a javascript function).

          Instead I tagged $modx->event->output to the end of my output with a simple <script> to initialise elRTE into the textarea. Theory worked, it loaded after the textarea was present and worked within Revolution 2.1.1.

          This is what I have so far:


          A beta download is available here for those wanting a play:

          http://www.cadcoder.com/index.php?id=20

          Thanks Bob and Susan for the help. [ed. note: cadcoder last edited this post 12 years, 5 months ago.]
          • Well, whatever goes on in MODx can't trigger a Javascript function, MODx works on the server while the Javascript all works in the browser. So you did exactly what you would have to do; the page being served from the server has to have the javascript you want written to the page, whether it's the whole page or via a return to an AJAX request from the browser.

            Anyway, I'm off to get the package; I'll be sure to let you know if I have any problems or feature suggestions.
              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
            • Well, a nice idea, but no go. The editor never gives focus, nor does entering anything in "source" view show in the rte view. What is most alarming is that it doesn't go away if I set the resource to not use the rte.

              Interestingly, on uninstalling I got this set of errors

              Removed modPlugin instance with primary key 2
              Skipping modPluginEvent object (data object does not exist and cannot be removed): Array ( [pluginid] => 6 [event] => OnRichTextBrowserInit )
              Skipping modPluginEvent object (data object does not exist and cannot be removed): Array ( [pluginid] => 6 [event] => OnRichTextEditorInit )
              Skipping modPluginEvent object (data object does not exist and cannot be removed): Array ( [pluginid] => 6 [event] => OnRichTextEditorRegister )
                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
                • 36905
                • 9 Posts
                What version of MODX are you running so I can setup a test environment.
                • It's today's nightly, 2.2 121611.
                    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
                    • 3749
                    • 24,544 Posts
                    Susan, what are the plugins (6 and 2). It looks like the uninstall removed plugin 2, but tried to undo the connections between plugin 6 and those system events (and the connections didn't exist). Maybe the system events didn't get attached or got attached to the wrong plugin during the install.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                    • I have no idea, BobRay. This was a shiny new installation with absolutely nothing else installed.

                      I wonder... cadcoder, have you been working on this on an installation with TinyMCE already installed? It could be that it's been developed expecting certain plugins and other settings being already set up by the TinyMCE installation?
                        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