We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44195
    • 293 Posts
    Hi all,

    I just published the second part of a MODExt tutorial series I'm working on. It continues on from the doodles tutorials.

    First part: http://www.hkwebdeveloper.com/modext-tutorial-series-part-1.html
    Second part: http://www.hkwebdeveloper.com/modext-tutorial-series-part-2.html

    Let me know if there's anything in particular you want included in the future parts.

    Cheers!
      I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
      Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
      • 42562
      • 1,145 Posts
      Very excellent share; I guess I am getting of age when I do not totally melt down in fear when I hear MODExt.

      Time to start learning this dark stuff
        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.
        • 3749
        • 24,544 Posts
        Nice! I too have developed a grudging admiration for modExt, though I still avoid it whenever possible. wink
          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
          • 44195
          • 293 Posts
          Thanks very much smiley
          It's a hell of a learning curve. Hopefully this helps people avoid at least some of the hair-pulling I went through!
            I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
            Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
            • 42562
            • 1,145 Posts
            Any chance this will be covered: open a Ext Window (iframe)?
            I think I need new glasses, as I have exhausted mine in searching for how to do this in:
            http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/custom-manager-pages/modext

            I know ExtJs can do this; is this something MODExt does not allow?
              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.
              • 4172
              • 5,888 Posts
              are you talking about an iframe in a MODx.window?

              This is, how I got it working for MIGX/MIGXdb:

              https://github.com/Bruno17/MIGX/blob/master/core/components/migx/templates/mgr/iframewindow.tpl#L79
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 42562
                • 1,145 Posts
                Exactly, an iframe.
                Thanks for the direction...I pray I can tweak your sample
                  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.
                  • 44195
                  • 293 Posts
                  I've never tried personally, but after seeing Bruno's excellent example I'm going to have a play.
                  What would you be using an iframe for?
                    I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
                    Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
                    • 42562
                    • 1,145 Posts
                    Okay I went to look at the code, and I think I should place an order on a coffin, just in case.
                    The code is definetely what I need, but I will have to work on it.

                    I have got a custom filebrowser in Manager that has an excellent callback.

                    I have a menu button in the Manager that pops this filebrowser up, but as you know, Chrome's(and others) popup is rather bizarre compared to the MODx' modal.
                    So for uniformity sake, I'd like to use MODx.window's iframe to load this custom browser.
                    And with the callback I mentioned, close this iframe window when done.
                      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.
                      • 44195
                      • 293 Posts
                      Well to start with, putting an iframe in a MODx.Window turns out to be really easy.

                      You can template it as simply as this:
                      Doodles.window.IframeWindow = function(config) {
                          config = config || {};
                          Ext.applyIf(config,{
                              title: 'iframe Window'
                              ,width:600
                              ,height:700
                              ,html: '<iframe src="http://www.hkwebdeveloper.com" style="width:98%; height:98%;"></iframe>'
                              ,buttons:[{
                                  text: 'Close'
                                  ,scope:this
                                  ,handler: function() { this.hide(); }
                              }]
                          });
                          Doodles.window.IframeWindow.superclass.constructor.call(this,config);
                      };
                      Ext.extend(Doodles.window.IframeWindow,MODx.Window);
                      Ext.reg('doodles-window-doodle-iframe',Doodles.window.IframeWindow);
                      


                      You're just using the html parameter. You can just call it the same way you'd call the other windows in the tutorial.
                      I'm just guessing but perhaps you could have your callback trigger an event and then put a listener on your window to close.

                      Is this the kind of thing you're after?


                      Edit: I overrode the buttons so you've just got a close button.


                      Rather than hard-code the iframe src like above you could pass a value from the grid:
                      },showIframeWindow: function(btn,e) {
                          if (!this.iframeWindow) {
                              this.iframeWindow = MODx.load({
                                  xtype: 'doodles-window-doodle-iframe'
                                  ,iframesrc: 'http://you-could-pull-this-string-from-the-grid.com'
                              });
                          }
                          this.iframeWindow.show(e.target);
                      }
                      


                      and then alter the html parameter in the template slightly to include the config value:
                      ,html: '<iframe src="'+ config.iframesrc +'" style="width:98%; height:98%;"></iframe>'
                      
                      [ed. note: muzzstick last edited this post 11 years, 2 months ago.]
                        I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
                        Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com