mjut Posted January 16 Share Posted January 16 Hi forum, I don't really know how to do this: I want to create multiple (not published but saved) pages. From that on, I want the pages to be published each page a day aromatically. I am sure, this is possible.. But where do I begin? Thanks for suggestions and input. Cheers Stephan Link to comment Share on other sites More sharing options...
bernhard Posted January 16 Share Posted January 16 Create a script that does what you want (publish one page) Trigger that script once a day For (1) read https://processwire.com/docs/front-end/include/ and for (2) you can either use https://processwire.com/docs/more/lazy-cron/ or - the better solution - a regular unix cron if possible. 2 Link to comment Share on other sites More sharing options...
mjut Posted January 17 Author Share Posted January 17 Thank you! @bernhard Link to comment Share on other sites More sharing options...
mjut Posted January 17 Author Share Posted January 17 Here is the script: #!/usr/bin/php <?php namespace ProcessWire; include("/home/stephan/www/index.php"); foreach ($pages->find("template=post, status=unpublished, sort=unpublished, limit=1") as $post) { $post->removeStatus('unpublished'); $post->addStatus('published'); $post->save(); } With cron it is triggered once a day and it will look for unpublished posts. If there are any, the oldest post will get published. Simple as that. I am using this script to update my photo blog https://photos.stephansimonis.com more regularly. ? 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now