We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    Is there an efficient way to export part of a site (a root-level resource and all of its descendents) as static HTML?

    I’m suddenly under pressure to make a few of our small MODx-based sites "go live" within the week. I’m not comfortable yet rolling them out with MODx as the direct back-end system, mainly because I’m nowhere near confident in my own ability to treat it as a production environment; I’m still constantly trying things and breaking them, and want to reserve my right to do that. I suppose I should eventually set up a development server and a production server, but for now I’m in need of a more immediate solution.

      • 18654
      • 191 Posts
      There are ways to create transport packages, but there’s a bit of a learning curve there. Another option might be to query the parent and each of its children to get the ids of the pages that you want an place them in an array. Then, loop through each page id and use $modx->makeUrl to create an array of URLs for the pages that you want to get static html from. Next, simply curl each page using the URLs (or I think even fopen now works with URLs now) and create files for each resource.

      On another note, if you go with MAMP / WAMP, it only takes about 5-10 minutes to get a development server setup. Then, as long as you install the same version on your development server (or another version that hasn’t changed the DB schema), you can just export all the tables that start with modx_site and you’ll be able to test all you want.

      I’m sure there’s better ways to do this stuff, but that’s just a couple of suggestions.
        God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
        • 22303 MODX Staff
        • 10,725 Posts
        The feature is on the list, but was simply prioritized very low. It’s scheduled for RC3.

        http://svn.modxcms.com/jira/browse/MODX-28
          • 13210
          • 3 Posts
          What is the status and prognoses for implementation ?
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: Itse_Moihnoha at Jul 28, 2010, 02:43 AM

            What is the status and prognoses for implementation ?
            Scheduled for 2.0.1 currently.