I’ve been working on some custom scripting to handle a dynamic news section on a clients site. Their site is using modX Evo 1.0.3. About half of the scripting is external from modx iteself, but here’s a rundown of what I have and what I need to get done:
Completed
- A cron script scrapes articles from various external sources.
- An email is sent to the user displaying article information with a link after each to "publish document"
- Once link is clicked, user is directed to a staging page where article information is populated into various form fields (publish date, title, description, etc).
Here’s where I need some help. On form submit, I’d like it to run a snippet, where a document is created in the news section of the page tree (I already have this set up in the page tree that manually-created articles are distributed to smaller sections using Ditto). I looked through the API and couldn’t find anything like what I was looking for (I was thinking of like a modx->createResource haha). Is something like this possible? Would it be easier to just directly inject information into the DB? Any help would be greatly appreciated. The site is
http://www.keystonebiofuels.com if that helps give a better idea of how the articles are being displayed. Hopefully this all makes sense, if more information is needed please just ask!
Thanks!