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

    How can I create one document/container dynamically by passing its name and some html code. Also , we want to get back its document id [newly created] .

    thanks & regards

    Jurdy
      • 15065
      • 138 Posts
      Thanks for your help , but I have one more problem

      I want to create a new document by passing formfield value as its pagetitle.

      In detail;
      I have one document which has one form and there is one text box and a submit button in it . I want to create a new document with the text field value as its [ new documents ] page title when I submit the submit button.

      How can I do this? Pls help
        • 22303 MODX Staff
        • 10,725 Posts
        First, make sure you realize this is just a third-party add-on script, and by no means an official way of doing what you are. With that disclaimer, you might try something like this...
        $doc->Set('pagetitle', $modx->db->escape($_POST['pagetitle']));

        where ’pagetitle’ is the name of the field you are posting from your form.
          • 15065
          • 138 Posts
          Thank you for your help. It works fine for me too.
          Pls help me in these issues also,
          1.How can I go to the newly created page by default [ I want to load the newly created page after its creation by default]
          2. How can I set user permission to the newly created pages. [ In detail, there is three type users Wholesale, Retail and Manager. Now the newly created document can access by three groups. I want to restrict it to Wholesale only.] There is any options for this at the time of creation.
          I couldn’t find much documentation on docmanager.

          Thanks & Regards,
          Jurdy
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: jurdygeorge at Dec 17, 2007, 09:59 AM

            1.How can I go to the newly created page by default [ I want to load the newly created page after its creation by default]
            You actually need to go to another landing page first; and you need to clear the cache after adding a page as the NewsPublisher snippet demonstrates so that the page is available on the next request. It simply is not available until after the cache has been cleared and regenerated.

            Quote from: jurdygeorge at Dec 17, 2007, 09:59 AM

            2. How can I set user permission to the newly created pages. [ In detail, there is three type users Wholesale, Retail and Manager. Now the newly created document can access by three groups. I want to restrict it to Wholesale only.] There is any options for this at the time of creation.
            You would need to add them to the appropriate document groups in the database tables. I do not know if docmanager supports these features.

            Quote from: jurdygeorge at Dec 17, 2007, 09:59 AM

            I couldn’t find much documentation on docmanager.
            I’m not sure if the author is still active in the community here. You’ll have to rely on support from other adopters of this code.
              • 11975
              • 2,542 Posts
              Hi,

              you should give a try to FDM (in development forum).
              It’s based on eform and docManager class (authored by Ur001) to allow document creation from front end.

              :-)
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 15065
                • 138 Posts
                thanks for your help

                how can I clear the cache using docmanager code after saving a document. Because we are creating documents as submenu of differnet main documents. And picking id of parent is at the creation time. So a landing page is difficult for this, I think. If you suggest any other way to clear the cache, it would be very helpful in this situation.

                Thanks & Regards

                Jurdy
                  • 15065
                  • 138 Posts
                  How can I get the last created documents id in the snippet ? [ID or alias of last created Document ]
                  Do I get form $_POST value in a snippet[ I mean , I have one form, in it one text box and one submit button is there. I want to get the content of the text box value in snippet] ?

                  Is there any options for these two things in MODx. If so, pls help me ASAP

                  Thanks & Regards

                  Jurdy George
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: jurdygeorge at Dec 20, 2007, 11:17 AM

                    How can I get the last created documents id in the snippet ? [ID or alias of last created Document ]
                    That depends on how you created it. And do you mean within the same request it was created, or on any request after it was created until a new one is inserted?

                    Quote from: jurdygeorge at Dec 20, 2007, 11:17 AM

                    Do I get form $_POST value in a snippet[ I mean , I have one form, in it one text box and one submit button is there. I want to get the content of the text box value in snippet] ?
                    You can always get the $_POST value in your snippets, if you $_POST data to the page.
                      • 15065
                      • 138 Posts
                      How can I get the last created documents id in the snippet ? [ID or alias of last created Document ]


                      I mean on any request after it was created until a new one is inserted