Posted by rudyard55 on April 29, 2012 at 10:55pm
Hello all,
I am new to rules (and Drupal for that matter.)
Rules, Tokens, views (installed and enabled)
I've successfully created rules to notify users by email when comments were added or when new nodes are created but I am having difficulty with this new task.
I created a custom content and added a field for "expiration date." I'd like to create a rule that would unpublish the content after the date in the expiration date field for the content. It seems like it should be a fairly straight forward task, but it is getting the best of me.
Any guidance would be greatly appreciated.
Thanks,
rudyard55
Comments
solved my own problem.
For the other noobs:
Here's how I got it to work. I went and got the scheduler module (http://drupal.org/project/scheduler)
After install/enable, give permissions to schedule content to all the roles that it applies to. (people/permissions/scheduler)
Then go to the specific content type that you are trying to schedule to publish/unpublish.(structure/content types). Edit the content.
At the bottom of the content type screen you will see "scheduler settings." Under "Unpublishing Settings" I checked the boxes for "Enable scheduled unpublishing" and "Unpublishing date/time is required." (I checked the second one because I wanted to require the author to create an unpublish date.
The "Publishing settings" give the author the opportunity to set the content to publish in the future... that's not what I was trying to do though. But they are there if you need them.
When you are checking to see if it works, don't forget to manually run Cron. Because depending on how far apart you have your cron checks set, scheduler won't publish or unpublish anything until the next cron run occurs if you don't do it manually. (configuration/cron/run cron)
Note: if you have the date module installed (http://drupal.org/project/date) then your authors can select the date from the popup calendar that it provides... I hate typing dates.
Hope it helps somebody.
Thanks for posting this
This was just what I was looking for!
A recorded example here
Here's an example of how to use Rules Scheduler for scheduling front page promotion – it should be fairly easy to translate into general publishing/unpublishing: http://skillcompass.org/resource/schedule-front-page-publishing
Good luck!
//Johan Falk, Sweden
Rules Scheduler is awesome.
Rules Scheduler is awesome. But what if I don't want to trouble the user with selecting the date (they might make a mistake). Instead what I want to do is to set the values of Publishing Settings automatically via Rules if the content match a certain conditions. The problem is, I don't think at the moment Scheduler is communicating with Rules :(