We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2396
    • 101 Posts
    I need to bulk generate a lot of (maybe 200 or so) empty documents in Revo. Evo had an Extra called SuperPage that did this. Does anyone know of anything similar in Revo? I am redeveloping and significantly redesigning a site from Evo to Revo but the document ID structure and most other fields besides Content are very different in the new site.

    I was planning on porting the content manually but (one of) the most tedious parts is generating new pages. Or are there any better suggestions?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Have you tried Provisioner? I wasn't able to get it to log in to the Evo site correctly, but others have had success with it.
        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
        • 3749
        • 24,544 Posts
        If you can export them to HTML (I think that's an option in Evo -- not sure), you can use the Import HTML option in Revolution. IIRC, it will use the filename as the pagetitle and alias and put whatever is in the body in the content field.

        http://www.webhostinghub.com/support/edu/modx/beginning-modx/how-import-html-modx

        In Revo, you can drag them around in the tree to create your structure.

        If you just want a bunch of blank documents, this snippet should do it:


        <?php
        $total = 200; /* or however many you need */
        $template = 12; /* ID of the template you want for them */
        $parent = 3; /* ID of a folder to put them all in (use 0 to put them in the root directory) */
        /* Important: Be sure to create the folder before running the snippet */
        
        for ($i = 1; $i <= $total; $i++) {
           $fields = array(   /* adjust these to what you want */
               'pagetitle' => 'Resource' . $i;
               'alias' => 'resource' . $i;
               'published' => true,
               'hidemenu' => false,
               'richtext' => false,
               'template' => $template,
               'parent' => $parent;
               'searchable' => true,
               'cacheable' => true,
           );
        
           $doc = $modx->newObject('modDocument', $fields);
           $doc->save();
        }


        FYI, if you do end up creating them manually, check out the three little icons at the upper right of the Create/Edit Resource panel. If you click on the left one, every time you save a resource, you'll go to a blank form to create another. Click on one of the other two when you're done.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 2396
          • 101 Posts
          Quote from: sottwell at Jun 14, 2013, 12:47 AM
          Have you tried Provisioner? I wasn't able to get it to log in to the Evo site correctly, but others have had success with it.

          Thanks for the response, Provisioner sounds quite good but the new site is on MODX cloud and provisioner says it won't work on 2.2 and above. I think the new structure is also too different to the old one so quite a few IDs will be different (yes, a big redirect job coming up...).
            • 2396
            • 101 Posts
            Quote from: BobRay at Jun 14, 2013, 01:18 AM
            If you can export them to HTML (I think that's an option in Evo -- not sure), you can use the Import HTML option in Revolution. IIRC, it will use the filename as the pagetitle and alias and put whatever is in the body in the content field.

            http://www.webhostinghub.com/support/edu/modx/beginning-modx/how-import-html-modx

            In Revo, you can drag them around in the tree to create your structure.
            ...
            FYI, if you do end up creating them manually, check out the three little icons at the upper right of the Create/Edit Resource panel. If you click on the left one, every time you save a resource, you'll go to a blank form to create another. Click on one of the other two when you're done.

            These sound like excellent solutions BobRay, thanks very much for the advice, I'll give them a try. This isn't really the place but by the way, the official guide is very nicely written. Are there any updates available or planned for the latest versions - mainly re media sources?
              • 3749
              • 24,544 Posts
              Thanks for the kind words. It's unlikely that there will be any upgrades until MODX 3 comes out.

              In the meantime, there is a nice tutorial here: http://rtfm.modx.com/display/revolution20/Creating+a+Media+Source+for+Clients+Tutorial
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 6629
                • 60 Posts
                ImportX should come in handy.

                I use it on every website to quickly build the basic site tree.
                  • 2396
                  • 101 Posts
                  Thanks DasItsch,

                  That does look interesting. The information I am importing seems like it might be too complex for ImportX but it does look like it would suit other projects I have in mind.

                  Quote from: DasItsch at Jun 15, 2013, 02:54 AM
                  ImportX should come in handy.

                  I use it on every website to quickly build the basic site tree.