Subscribe: RSS
  • I wrote this code last night that will take an unordered list of page titles and insert pages into the database. I used this code to add 650+ pages to a site from a list my client gave me in Microsoft Word. I get these all the time so I thought it would be cool to go straight from a list to MODx pages. Until this time I used the SuperPage Module, but this is faster. This is the development forum so I’ll just let you read the down and dirty code (attached), but feel free to ask questions. This would be really easy to turn into a module, so I might do that at some point.

    To use, run this script from your local or remote web server and point your favorite web browser at it. Enter your list into the text area and click submit (your list probably needs to be xhtml valid in order for it to work right). There are a few vars in the script that you can adjust, so take a peek there.

    I’m interested to know what others think of this, and if anyone else has some cool helper scripts like this...

    James
    • This sounds cool, can be a real time saver. I will use it for setting up the structure for my next project. Thanks.

      Sorry, I don’t have any cool tools to share yet.
        [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]
      • Quote from: dev_cw at Nov 14, 2007, 09:04 PM

        This sounds cool, can be a real time saver. I will use it for setting up the structure for my next project. Thanks.

        Sorry, I don’t have any cool tools to share yet.

        Great, I hope it works for you. smiley
        • Can you save a zip file? I can’t open the ’gz’.

          Thanks!
            • Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
            • Quote from: sottwell at Nov 15, 2007, 09:22 AM

              http://www.7-zip.org/

              Thanks, but I think it’s for PC only. I am on Mac, have the default BOMArchiveHelper and Stuffit Expander Intel Mac version (this one kept crashing though). Actually Stuffit Expander can open ’gz’, but I have encountered quite many gz files from Modx are other CMS, JS library sites are corrupted . I think the problem is not to do with my Expander but the file that was created or during the upload to server(s) got corrupted.
              • Ah. I have an older (well, almost 2 years old) G4 iBook, and the latest update to Stuffit (12, I believe) works just fine. Earlier it was crashing rather frequently on archives from MODx. So I used this

                http://leifh.up.md/apps/ez7z.html
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                • Quote from: chinesedream at Nov 15, 2007, 08:33 AM

                  Can you save a zip file? I can’t open the ’gz’.

                  Thanks!

                  Zip file added in case you are still having issues. If you’re on OS X, can’t you just use the command line though?

                  Anyway, it’s been added to the original post.

                  James
                  • Quote from: devtrench at Nov 15, 2007, 06:07 PM


                    Zip file added in case you are still having issues. If you’re on OS X, can’t you just use the command line though?

                    Anyway, it’s been added to the original post.

                    James

                    Many thanks! James.
                    I don’t know how to use command line to to un-gz. Terminials isnt’ a place I dare to wander : grin Alwalys afraid to screw up my files (that I am quite capable of messing things up)
                    • Quote from: sottwell at Nov 15, 2007, 10:31 AM

                      http://leifh.up.md/apps/ez7z.html
                      Thanks for the link. I will try it now.

                      I installed the Expander about 10 months ago. Maybe it has a new version I didn’t know, will check it out too.