We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26799
    • 177 Posts
    I love modx. -- wanted to make that clear...

    [!newsletter?mode=`doc`&accessWeb=`newsAdmin_users`&emailGroup=`newsletter`!]
    


    I need to get only documents out of a particular container using the newsletter Snippet. I’ve perused the snippet and there only seems to be one method for achieving this through a "doc-group" assignment. This isn’t a very good solution for me and I was wondering if I’m missing something.

    I’m using [!newspublisher!] to publish the documents through the front end and it doesn’t seem to have the ability to assign the document to a group.

    the Ideal solution would seem like a simple enough mod to newsletter to add a passable param that would select docs out of a parent like [!Ditto!].
      • 26799
      • 177 Posts
      I’m really desperate here. I need [!newsletter!] to get it’s list from a container or I need [!newspublisher!] to create documents within a particular document group. I looked through [!ditto’s!] code and I don’t understand how it’s doing it. I see the method but I can’t seem to grasp it. is a there an API function available for getting documents based on a container?
        • 14050
        • 788 Posts
        I would take a look at the document.parser.class.inc.php that is in your modxroot/manager/includes folder. It has API functions called getAllChildren and getActiveChildren that should be able to get the "all" or "active" documents inside a container. It returns an array representing the data of those documents, so it will require some scripting to handle that data.
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.