I have a few pages that need to be manually saved in order to make the site work. I installed Cron Manager thinking this would be the best path but am struggling to figure it out. Searched other forums but didn't see the answer. Possibly there is a better way besides Cron. Open to any and all suggestions.
I have a few pages that need to be manually saved in order to make the site work.
Can you say more about what you mean by this? It's difficult to understand because Cron Manager would save them automatically, not manually.
If we knew more about your use case, we might be able to suggest alternatives. Why do the pages need to be saved? How often and when to you want them saved?
Hey Bob, thanks for always coming to the rescue.
I have event pages that I don’t want to unpublish, so instead I have made a TV for the date and time that the event ends. Unless I go in and save one page, that event still shows current. Essentially, I want modx to do whatever it needs to do to trigger this. Just once a day around midnight works fine.
-
☆ A M B ☆
- 3,141 Posts
Try wrapping the snippet you're using to list those events (get/pdoResources?) in
getCache with a 24 hour (or lower) cache lifetime. No need to save resources to refresh the cache that way.
Could you use a snippet on the template that checks the current time/date and displays different content based on whether the time/date is in the future, or the past? This way the page would not need to be re-saved to change the content displayed.
There is a post here that discusses the idea. The code is for Wordpress but I presume you could use similar php to create a snippet that works for MODX:
https://stackoverflow.com/questions/9493167/display-content-based-on-date-with-php