We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    I've spend now three days to get different richtext-editors working together with MIGX.
    supported rtes for now (version 2.5) are:

    tinyMCE and ckEditor

    this are the files, needed to get them working:
    https://github.com/Bruno17/MIGX/blob/master/core/components/migx/elements/tv/input/migxckeditor.class.php
    https://github.com/Bruno17/MIGX/blob/master/core/components/migx/elements/tv/input/migxtinymce.class.php

    https://github.com/Bruno17/MIGX/blob/master/core/components/migx/elements/tv/ckeditor.tpl
    https://github.com/Bruno17/MIGX/blob/master/core/components/migx/elements/tv/tinymce.tpl

    important are these functions, if you want create support for other rtes:

    field.onLoad - fired when the textarea is loaded into the window, this should create the rte-instance for this textarea
    field.onHide - fired before the window is closed, this should destroy the rte-instance
    field.onBeforeSubmit - fired before the form-values are collected, this should make sure the rte-content is saved to the textarea


    to use richtext-editors just use inputTVtype: richtext
    MIGX will use the internal input-type setted with the system-setting: which_editor
    and does switch to the internal rte-input-type, if the class-file for it exists, otherwise it falls back to textarea.

    its also possible to set the internal inputType directly, for example: migxtinymce or migxckeditor
    But this may break the file-browser-support, because of the filebrowser is using the system-setting: which_editor.

    This means, if you want to use different rtes on different fields with filebrowser-support this will need some custom-work.






    [ed. note: Bruno17 last edited this post 13 years, 3 months ago.]
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 17249 ☆ A M B ☆
      • 165 Posts
      Both rich text editors are working but the top menu still disappears.
      Any suggestions?
        • 4172
        • 5,888 Posts
        I know that. This is in Chrome, right?
        This is another story.
        I have no idea what's the reason for that issue.

        I found you can get back the top-menue by opening the popup-window again with the tab where you have a richtext-editor, not touching anything and close the window.
        This lets the top-menue get back.

        the top-menue is still there in the dom, but is not longer displayed for some reason, as soon as you open a tab with a rte in it.
        No matter, which one.

        you can also move the top-menue with console-commands to other places and you will see it coming back

        perhaps there are other guys out there, who want to spend some days to find out what goes wrong here.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 17249 ☆ A M B ☆
          • 165 Posts
          Yes. I'm using Chrome.
          Thanks for the update on this.
          When i last checked this ended up thinking the issue was directly related to an specific RTE.
          Will try myself again today to see if problem can be tracked down and isolated.

          UPDATE:

          I've made a DIFF between the two states to compare before/after the tab with RichText is clicked and found something weird:
          an ID is being added to the HTML node


          Maybe someone knows if this is a normal behavior. I don't have much experience with ExtJS
          Why an id is added to the root node of the entire page when this specific tab is clicked?

          Note the id="ext-gen386" being added on the <html> tag

          --- from_file 
          +++ untitled 1 
          @@ -1,4 +1,4 @@
          -<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" class="  ext-strict x-viewport" id="ext-gen386"><head>
          +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" class="  ext-strict x-viewport"><head>
           


          Along with a bunch of other default states in the head script there is:
          <script type="text/javascript">
          	Ext.onReady(function() {
          		MODx.defaultState = {"ext-gen386-tree":"\/Files"};
          	});
          </script>
          


          Other small changes are applied when clicking the tab but seems they are not directly offending and are part of the normal behavior for switching the tab on/off and making the tab active:

          this css classes are added/removed in the DIVs of Tabs

          x-tab-strip-active
          x-hide-display
          



          UPDATE:
          The id attribute is not being added to the <html> tag when using Firefox [ed. note: lithiumlab last edited this post 13 years, 4 months ago.]
            • 17249 ☆ A M B ☆
            • 165 Posts
            Quote from: Bruno17 at Jun 11, 2013, 03:40 PM
            I know that. This is in Chrome, right?
            This is another story.
            I have no idea what's the reason for that issue.

            I found you can get back the top-menue by opening the popup-window again with the tab where you have a richtext-editor, not touching anything and close the window.
            This lets the top-menue get back.

            the top-menue is still there in the dom, but is not longer displayed for some reason, as soon as you open a tab with a rte in it.
            No matter, which one.

            you can also move the top-menue with console-commands to other places and you will see it coming back

            perhaps there are other guys out there, who want to spend some days to find out what goes wrong here.



            Your commmit
            https://github.com/Bruno17/MIGX/commit/267c92028cfa55ed26aa5961c869916fe5438911

            Does fix this problem.
            Hurrah

            The top menu issue was related to this one.