We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42562
    • 1,145 Posts
    https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#wiki-customData
    Feel free to study how elFinder on its own works.

    In the spirit of flexibility and separation of language and other important security whatnots, elFinder software makes elFinder.html send data to its connector via customData and not via its url: elfinder.php directly

    Because of integration with MODX, the part to be user-configurable is brought out into a snippet.
    Ordinarily, the snippet code should all be in elfinder.php

    elfinder.php before it loads the snippet must get only pset parameter from elFinder.html - to know how to handle the snippet
    The snippet gets the other URL parameters from the elFinder.html which sends its own url parameters via customData

    At this rate, seeing that [[!TinymceWrapperGetUrlParam]] purifies all the data coming through, one may safely append all necessary parameters straight to
    url : "elfinder.php..."
    and thus bypass customData

    If you bypass customData ... you void your ability to customize elFinder via elFinder.html url parameter on the fly.

    You can lock elFinder by default using the snippet property.
    A sudo admin can unlock all of elFinder on the fly using url parameter unlocked despite what the elFinder snippet has in action.

    Perhaps this has cleared you understanding of how elFinder works.

    Cheers
      TinymceWrapper: Complete back/frontend content solution.
      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
      • 36516
      • 179 Posts
      Thanks for that Don. I had to read through it a few times to get on the same page, but when I did it made sense. I believe I understand how it works, so given that my problem seems to be only my own I'll look into it when time allows. If I find anything that might interest you I'll report back. I would be curious to know if you're testing having installed the addon the same way I have, or if you're making inline, "on the fly" changes to your existing code. I'll give you the benefit of the doubt and assume the problem probably isn't a result of the addon installation process that you'd experience if you reinstalled as I have done.

      I have another issue I'm hoping you can shed some light on. It could be a use case you haven't considered yet though. I've only just dabbled in nested Migx fields for the first time recently. I had imagined it would work like any other field but it turns out there are issues which have been discussed on this forum in considerable detail.

      My issue is simply that it appears elfinder isn't being triggered for TVs within nested Migx objects. I have a list within a list, and though the outer list doesn't actually have a TV to test, I have other individual TVs which are working fine elsewhere on the same site. It's only the TVs in the sub-migx list which revert back to the native browser. Does this arrangement necessitate additional migx-related elfinder config? The CSS selector is surely the same.
        • 42562
        • 1,145 Posts
        RE: Dave Smith thanks for the feedback

        If it is any consolation, I install TinymceWrapper from MODX packages, just like the average me, on https and http, on diff systems.
        Please keep searching and report when you find something.

        elFinder on MIGX TVs
        I have managed to make my work as lightly integrated as possible. And if I might not understand your scenario, I cannot see why elFinder action reverts to MODX native.
        It should not matter where you are using TinymceWrapper's TinyMCE RTE browsers.

        Questions for you
        * Do you have any errors in your browser's inspector?
        * In MIGX nested whatnot, what you are using is actually TinymceWrapper's TinyMCE RTE - to transform TV textarea?
        * You try to access elFinder from the RTE's toolbar?
        * You have set your autoFileBrowser in the TinymceWrapper's plugin to elFinder?
        * You are using the correct chunk as prescribed by bruno17 which can be found under TinyMCE/Backend/3rdPartyChunks/sample.TinymceWrapperMIGX (remove the "sample" to protect/use - does not take chunkSuffix)

        NOTE
        In this chunk, you will not find the customary dynamic placeholder [[+commonTinyMCECode]] but rather a fixed call to a chunk that must exist [[$TinymceWrapperCommonCode]] - which at this rate uses a custom chunkSuffix

        Since I have only very lightly tested with MIGX, further details can be forwarded to bruno17
        sample.TinymceWrapperMIGX
        tinymce.init({
          mode: "exact",
          elements: "tv[[+tv_id]]",
          [[$TinymceWrapperCommonCode]]
          plugins: "autoresize,preview,paste,contextmenu,image,wordcount,fullscreen,code,link,charmap,searchreplace,textpattern,emoticons,insertdatetime",
          paste_word_valid_elements: "a,div,b,strong,i,em,h1,h2,h3,p,blockquote,ol,ul,pre",
          valid_elements: "iframe[*],object[*],audio[*],-span[!title|!class<test test2],a[href|target|class|rel|title|data-ajax|data-iframe],strong,b,-p[class<text-align-left?text-align-center?text-align-right],br,-h1[class|data-ajax|data-iframe],-h2[class|data-ajax|data-iframe],-h3[class|data-ajax|data-iframe],-img[!src|!alt|!class=round_img|data-ajax|data-iframe],em,-blockquote,pre[class],-ol,-ul,-li,-code[class]",
          valid_children: "-li[ul],-li[ol],-li[div],-strong[*],-em[*],-h1[*],-h2[*],-h3[*],-a[strong|em|h1|h2|h3|p|div],blockquote[p|ol|ul],pre,div",
          resize: true,
          autoresize_min_height: 100,
          autoresize_max_height: 400,
          toolbar: "newdocument | fullscreen preview | undo redo | blockquote | bold | italic | aligncenter | bullist numlist | link unlink | image | styleselect | charmap emoticons insertdatetime | searchreplace",
          contextmenu: "removeformat | link | image | code",
          setup: function(editor) {
            editor.on('mouseleave', function(evt) {
              tinyMCE.activeEditor.save();
            });
          }
        });


        TinymceWrapperCommonCode (or whatever you name it, if used must have file_browser_callback : autoFileBrowser,
        This JS function is what successfully and automatically feeds the RTE the correct File Browser, as selected in the TinymceWrapper plugin. It is possible you have using a different setting, an old one perhaps from a deprecated chunk.
        skin_url: MODx.config.assets_url+'components/tinymcewrapper/tinymceskins/modxPericles',
        link_list:[
        [[$TinymceWrapperLinkList]]
        ],
        relative_urls: false,
        remove_script_host: false,
        document_base_url: MODx.config.site_url,
        link_class_list: [
          {title: 'None', value: ''},
          {title: 'prettyLink', value: 'prettyLink'},
          {title: 'colorBox', value: 'colorBox'}
        ],
        image_class_list: [
          {title: 'None', value: ''},
          {title: 'prettyPhoto', value: 'prettyPhoto'},
          {title: 'colorBox', value: 'colorBox'}
        ],
        image_caption: true,
        browser_spellcheck: true,
        gecko_spellcheck: true,
        paste_data_images: false,
        menubar: false,
        statusbar: false,
        image_advtab: true,
        textpattern_patterns: [
          {start: '*', end: '*', format: 'italic'},
          {start: '**', end: '**', format: 'bold'},
          {start: '#', format: 'h1'},
          {start: '##', format: 'h2'},
          {start: '###', format: 'h3'},
          {start: '####', format: 'h4'},
          {start: '#####', format: 'h5'},
          {start: '######', format: 'h6'},
          {start: '1. ', cmd: 'InsertOrderedList'},
          {start: '* ', cmd: 'InsertUnorderedList'},
          {start: '- ', cmd: 'InsertUnorderedList'}
        ],
        setup: function(editor) {
          editor.on('keydown', function(evt) { 
            if (evt.keyCode == 83 && evt.ctrlKey && !evt.shiftKey && !evt.altKey && !evt.metaKey) {//ctrl + s = save 
              evt.preventDefault();
              $('#modx-abtn-save button').trigger("click");
            }
            if (evt.keyCode == 27) { //escape key = remove fullscreen 
              evt.preventDefault();
              if ($('.mce-fullscreen').length) {
                tinymce.activeEditor.execCommand("mceFullscreen")
              }
            }
          });
          editor.on("init",function() { //float fullscreen link
          containerId = $(editor.getContainer()).attr("id");
           $("#"+containerId+" .mce-i-fullscreen").parent().parent().parent().parent().css("float","right");
          });
        },
        external_plugins:{
          twCodeMirror: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twCodeMirror.js",
          // bubbleBar: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/tinymceBubbleBar.js",
          modxMagicHoverLink: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/modxMagicHoverLink.js",
          twPreCodeManager: "[[++assets_url]]components/tinymcewrapper/tinymceplugins/twPreCodeManager.js"
        },
        content_style:twPreCodeManagerPREcss,
        twCodeMirrorPoppedOrInline: 1, //1 for popped (default), 0 for inline
        //hoverStripMODXurl:false, //default is true
        //hoverAddCLASStoTree:false //default is true
        file_browser_callback : autoFileBrowser,
        //leave trailing comma
          TinymceWrapper: Complete back/frontend content solution.
          Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
          5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
          • 20025
          • 6 Posts
          Quote from: donshakespeare at Mar 18, 2016, 12:49 AM
          In your TinymceWrapper Plugin Properties (preferably your own pset), turn off TinyJSONGallery
          enableImageGallery ........... No


          If enableImageGallery is turned on ...creating new resources of any kind (Articles included) bounces a blank dead error page

          That helped, thanks a lot!
            UNSIGNED, NOT NULL
            • 36516
            • 179 Posts
            Hi again Don. Going a little off the former subject, and returning instead to something I mentioned a while back about a mysterious new image editing facility I'd seen but couldn't replicate: I've since spotted it again and here's a screenshot of the interface in question. I'm guessing it's just part of TinyMCE that I hadn't noticed before, but it's pretty nice.
              • 36516
              • 179 Posts
              I can't see the attachment unless I'm logged in. Is that normal?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Apparently that's normal. I can't see attachments unless I'm logged in either.
                  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
                  • 4172
                  • 5,888 Posts
                  @Dave Smith
                  your field of the nested MIGX, what you are talking about, is this a richtext-inputTVtype?
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 36516
                    • 179 Posts
                    Hi guys. Apologies for the delay, though I'm sure it's more of a problem for me than it is for you.

                    @Bruno: The nested field for which I'm unable to trigger elfinder is actually a standard image TV. A real TV I've set up with a Media Source which ironically I can actually use so long as elfinder refuses to work. I've half a mind to continue with the default browser in this instance because it'll help the site admins control where the uploads end up. So to clarify, I'm not using a Migx built-in image type.

                    Also, I'm not sure if you've seen this, or perhaps you have but it was tl;dr, but I've explained another nested migx issue I'm experiencing, which happens also to affect the very same image field which I've been unable to successfully render as a thumbnail in the grid, though it's working fine on the front-end: https://forums.modx.com/thread/79637/migx-within-another-migx?page=4#dis-post-539836. I'd very much appreciate your input, and possibly even the opportunity to contribute constructively to your project.
                      • 36516
                      • 179 Posts
                      Perhaps I'm coming to a realisation: should I only expect elfinder to pop up when I'm using RTE fields, as opposed to other TV types that require a file browser? That makes a certain degree of sense, though it's leaves me wondering what I can do about it, given that at some point I'm going to need to decide if I want one browser or the other; a decision I'm likely to base on how highly I value Media Sources and whether elfinder can in fact be used exclusively through the whole manager.

                      Obviously I can use elfinder as a general file manager from the top manager menu, but that's a custom link.