We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16173
    • 14 Posts
    Batch add/modify documents’ content?

    How to batch add or modify all documents’ content under a parent instead of one by one copying and pasting?

    The situation:
    I’ve written a Perl script (yeah, I know Perl, not PHP) to generate bunch of documents on my local machine.
    Is it possible to batch add or modify all the documents once?

    If not, I think I have to copy the Modx template and use it to generate the documents in static pages then upload them bypass Modx :-(.
      • 25663 MODX Staff
      • 12,272 Posts
      You could explore the HTML import option... stick a bunch of HTML files in the assets/import/ folder then run it.

      [Editor’s note: clarified the location of the import folder]
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 16173
        • 14 Posts
        Quote from: rthrash at Oct 16, 2007, 04:10 PM

        You could explore the HTML import option... stick a bunch of HTML files in the assets/import/ folder then run it.

        [Editor’s note: clarified the location of the import folder]

        That’s OK to convert static page to dynamical page.
        But the problem is, I have to generate the whole HTML, thus I can’t reuse the template in Modx.
        I have to use another template (or copy and modify the template used in Modx) to generate the HTML.

        I think Modx should support such a feature: import from XML files and in the XML, one node indicates Title, one indicates Contents, some other one may indicate alias or others. Then Modx stores those data to the database then generate the pages from the data.
        That idea is like to edit a document with XML file rather than field by field.

        Is this idea useful and should I put it to the wish list forum?
          • 25663 MODX Staff
          • 12,272 Posts
          For those that have XML as source files for documents it would be very useful I imagine.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 16173
            • 14 Posts
            I’ve just post a feature request here,
            http://modxcms.com/forums/index.php/topic,19093.0.html

            grin