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

    I am porting over a webpage to Modx that has a Flash menu. The content that populates the menu is in a separate XML file. When the page loads, the SWF loads this info from the XML file.

    ??? Here’s my question. In my static website, I just put the URL for the menu link in the XML file. That worked fine. However, now that I’m moving to a CMS, how can I make sure that the links in the XML file will work?

    For example, I have a link for my current Contact page in the XML file like "http://www.mysite.com/contact.html". No problem in the static environment. However, now in the CMS, my webpage names can actually change (right?). So, my Contact page (for now) may be "http://www.mysite.com/index.php?id=15". Right?

    When I update my Contact page in Modx, might the page name change? For example, maybe it changes to "http://www.mysite.com/index.php?id=16".

    Is the solution to put a link in like the way you link to a css file or other image in Modx? For example: [(base_url)]assets/mypage.html" />

    Unfortunately, I’m not a PHP programmer, so please forgive my naviety.

    I appreciate any detailed help.

    Peace,
    Loren
      • 9130
      • 171 Posts
      Since that the content of your website is dynamically generated the xml file should be dynamically generated as well. Instead of having a static xml menu file in the filesystem you should use a Modx document as the xml file and let modx keep the links up-to-date automatically. As an example take a look at Flash CMS.

      What you actually need to do is as follow:
      1. Open a new document, set the template to ’(blank)’, set the content type to ’text/xml’ - now you have a xml document. Copy and paste your current static xml into this document, point your flash menu to read this document and test that it works.
      2. Now you need to replace the links in your document with a Wayfinder snippet call that will generate the links automatically and you will need to change the default wayfinder configuration in order generate the desired xml instead of the default html list.


      p.s. the url and document id don’t change when simply editing a document, in fact they almost never change.
        • 7231
        • 4,205 Posts
        Use the XML file generated by MODx dynamically so that the links will change accordingly. You can use Ditto to output the XML (or Wayfider) according to the MODx document tree and have the URLs follow your friendly URL settings.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 12889
          • 4 Posts
          Thank you for the information.

          As I’m still new (as of this a.m.) to ModX, I’ll see if I can figure it out. If not, should I just post here again?

          I want to be sure I’m posting in the correct spot.

          Peace,
          Loren smiley
            • 12889
            • 4 Posts
            huh OK. I think I need more explicit directions. Remember, I’m not a PHP programmer (i.e. Ditto, etc.). For that matter, I’m not the master of XML either. LOL.

            I understand how to create the XML in MODx. I created it and see it on the tree.

            huh What I don’t understand is:
            1. What address to give my Flash menu to connect to it in MODx, to see if it works, as you suggested. Why does the XML appear in the tree and not in like the Assets folder?


            2. I’m not sure what address to put within the XML. For example, take this subitem from the current XML:
            <subitem label="Welcome from Jim" url="welcome.html" target="_blank" />

            I’m not sure how to set it up to replace "welcome.html" with whatever page "welcome" would be in MODx.

            So, in essence most of my issue is referencing. However, the remaining issue is how to setup the XML file and Flash file to point to a dynamic file in ModX.

            I have attached the complete XML. I don’t know if that will be helpful.

            I apologize, guys. I’m feeling like you have to spoon feed me on this. I know everyone is real busy. Thanks, in advance, for your efforts and patience.

            Humbly,
            Loren embarrassed
              • 9130
              • 171 Posts
              Quote from: indymediadesigner at Apr 01, 2009, 09:13 AM

              1. What address to give my Flash menu to connect to it in MODx, to see if it works, as you suggested. Why does the XML appear in the tree and not in like the Assets folder?
              All dynamic content appears in the document tree, the assets folder contains only static files.
              The address to give to your flash menu would be the address of the xml document, if you pass this through html in a MODx controlled document or template you can use ’[(site_url)][~17~]’ (replace17 with the xml menu document id ). If you hardcode the url in your flash then the url should look something like http://www.mysite.com/index.php?id=17.


              2. I’m not sure what address to put within the XML. For example, take this subitem from the current XML:
              <subitem label="Welcome from Jim" url="welcome.html" target="_blank" />

              I’m not sure how to set it up to replace "welcome.html" with whatever page "welcome" would be in MODx.
              Again replace the url just like you would do in any MODx html document, use [~id~]:
              <subitem label="Welcome from Jim" url="[(site_url)][~17~]" target="_blank" />

              (here replace 17 with the welcome page document id obviously)
              You don’t have to go through with replacing all the links manually because later you will want to replace this xml with a wayfinder snippet call that will generate the menu automatically from the document tree, just do a few so you can see that its generally working.

              So, in essence most of my issue is referencing. However, the remaining issue is how to setup the XML file and Flash file to point to a dynamic file in ModX.
              I have attached the complete XML. I don’t know if that will be helpful.

              I apologize, guys. I’m feeling like you have to spoon feed me on this. I know everyone is real busy. Thanks, in advance, for your efforts and patience.
              No worries, we all started somewhere wink