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

    first off i like to say what a great little CMS this is grin i love it!

    i have been trying to integrate modx with flash. At the moment I have a simple flash website with 4 sections. Each section is an xml page in the modx manager, which I then pull into flash. Works great for simple text edits smiley

    so my question is, is it anyone possible to have some form of front end editing in a flash site.. this sounds a bit scary, but what I want to be able to do is add a link to each section which launches the modx xml page in a popup window.. so it works much like the normal front end.. is this anyway possible?

    Many thanks,
    Gareth

      • 7455
      • 2,204 Posts
      I am not sure but you could try to use the html or custom link way of using frontedit tags. http://modxcms.com/quickedit.html
        follow me on twitter: @dimmy01
        • 1764
        • 680 Posts
        If I’m understanding what you’re trying to do then I’d say this should be fairly simple. QuickEdit links are really nothing more than that, links. The tricky part (if you’d like to render the edit links inside flash) is that you’ll have to deal with figuring out whether or not the user is logged in and their edit rights to the page/TV, etc.
          • 10357
          • 573 Posts
          Hi,

          sounds like it is possible grin

          one quick question, where can i find the QuickEdit module id of a page??

          cheers,
          G
            • 22303 MODX Staff
            • 10,725 Posts
            It is possible; though we need a good proof of concept here in the community wink. I’m actually working on a site now that will have both a traditional MODx interface, and an alternate complete Flash site (from a template monster template actually); in this case, I’ll provide the QuickEdit module on the traditional pages and then most likely, create alternate dynamic XML page that pulls in the content from a requested page (along with any other important data I might want in the Flash movie; like logged-in user data, etc). Not being familiar with using XML inside of Flash though, it may take me a while to work this out, so feel free to share anything you do accomplish in making this work (it’d help me out greatly, at least laugh).

            As for your question regarding QuickEdit module id of a page -- I’m not sure I am clear on what you are asking, but every page has an ID, and the QuickEdit plugin component uses the current page ID to determine what editor features to present on the front end when viewing that page. Does this help?

            On a related note, I wonder if we could find a way to provide native MODx data as XML content to Flash and AJAX components from the same MODx facility...just thinking out loud...seems like the requests/responses could be handled by Javascript and Flash in a similar manner, but again, my Flash knowledge is limited.
              • 1764
              • 680 Posts
              Quote from: g5604 at Jan 30, 2006, 11:50 AM

              one quick question, where can i find the QuickEdit module id of a page??

              As Jason mentioned every page has a page ID (it shows up in the manager beside the page name in the document tree). But QuickEdit also has a module ID (every module does) an it can be different in ever installation of MODx. The module ID is sort of a behind the scenes thing that is not especially easy to find. The easiest way is view teh source of a page that is showing the QuickEdit toolbar and look for this line

              var modId = '1';

              a couple of lines down from the
              <!-- Start QuickEdit headers -->

              comment.

              The number between the apostrophes is of-course the module ID for QuickEdit. It’s usually 1 because QuickEdit was the first module to be released with the core but that’s not necessarily always true.

              If you need to find the module ID in code I suggest you run a query for it matching by the module GUID, which should never change (I think).
                • 10357
                • 573 Posts
                Hi,

                when i get this sorted i will share it on the forum grin

                well it works!! needs a bit of tweeking but it does work. grin

                edit_btn.onRelease = function () {
                getURL("http://localhost/mymodxsite/manager/index.php?a=112&id=1&doc=10&var=content");
                }

                just need to work out how to check to see if someone is logged in our not.. any ideas grin

                working with xml in flash is very simple:

                var my_xml:XML = new XML();
                my_xml.ignoreWhite = true;
                my_xml.onLoad = function(success:Boolean):Void {
                if (success) {
                news_txt.styleSheet = styles;
                news_txt.text = my_xml;
                } else {
                trace("Error loading XML.");
                }
                };
                my_xml.load("http://localhost/mymodxsite/index.php?id=10");

                i simply setup a style sheet to handle all the tiny mc tags.

                cheers,
                G
                  • 22303 MODX Staff
                  • 10,725 Posts
                  just need to work out how to check to see if someone is logged in our not.. any ideas

                  There are several approaches to checking this, but I’m betting you’ll need some way to turn this into an XML response? There are the methods in the API like $modx->getLoginUserId() or $modx->checkSession (checks for manager session specifically), or there are $_SESSION vars you can check directly (see $modx->checkSession implementation in /manager/includes/document.parser.class.inc.php) to verify the same thing...API being the preferred method of course.
                    • 10357
                    • 573 Posts
                    hi,

                    thank for the info, i will look into it, although i am not very familar with php so any help would be great grin

                    cheers,
                    Gareth
                      • 10357
                      • 573 Posts
                      small update.. to open the quick edit window correctly in flash:

                      edit_btn.onRelease = function() {
                      getURL("javascript:NewWindow=window.open('http://localhost/mymodxsite/manager/index.php?a=112&id=1&doc=10&var=content','news','width=525,height=300,left=0,top=0,toolbar= No,location=No,scrollbars=No,status=No,resizable=N o,fullscreen=No'); NewWindow.focus(); void(0);");
                      };


                      i have been having no luck with creating a login script in flash so far sad