Hi
My problem: Everyday at a certain time, I have to create a resource in modx (let's call it a news page).
Is there a way to tell modx to automatically create this resource for me so I don't have to go into the manager, duplicate existing resource, adjust title and save it?
Thanks
Modx 2.1.3, PHP 5.2
can't u use publish date?
Evolution user, I like the back-end speed and simplicity

-
MODX Staff
- 2,502 Posts
Can you describe what the page content is? Whats the purpose of this new document? This can be done with a plugin provided you have regular site traffic. Otherwise you're going to need to use a cron job and fire a plugin via the api.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
@fourroses666 I can use publish date to put the resource online at a certain time but I still have to create the source manually and because that would be a everyday task not only for one document, I'am trying to automate this.
@Jay Gilmore: The page content is just a iframe with a videofile and some text that describes the video. I also thought about a cron job but I don't know what php code to fire. Do you know if there is already a plugin for this kind of task?
Modx 2.1.3, PHP 5.2
-
☆ A M B ☆
- 427 Posts
Cron job using Curl or whatever to call a published page hidden from menus would be the simplest and most reliable, I would assume.
How does the video file and text get to the server?
Perhaps this process can create a resource with the content at the same time with a publish date if needed.
Is it the same URL each time? If so, a snippet or plugin could check the editedon field against today's date and regenerate the page content if they don't match.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODx info for everyone:
http://bobsguides.com/MODx.html
@W.Shwawn Wilkerson: I also thought about a cron job but what I can't get is how to create or duplicate a resource. But as Jay Gilmore wrote, a plugin might be the solution.
@whistlemaker: The Video file lies on an other server and the text gets to the server via a form that the user fills out. The form data goes into a custom db.
@Bobray: I'm not shure if I understand you correctly. What URL do you mean?
My resource tree looks like this: home->shows->news. Inside news folder a resource should be generated each day (120101_news, 120102_news, 120103_news...)
But what I don't get is how to thell a snippet or a plugin that it should create or duplicate a existing resource.
Modx 2.1.3, PHP 5.2
I meant are you regenerating the same page each time or is it a new page. If it's the same page, you could use the method I described.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODx info for everyone:
http://bobsguides.com/MODx.html