...very surprised not to find the word "repeat" or "rotate" in any of the issues for this module. The prospect of having certain content published on a repeating or rotating schedule just seems so natural...

You want some reminder up throughout the day on Mondays (every Monday but only on Mondays).

Put up the notice about the monthly meeting for the 1st week of every month.

Put up the holiday banners every fall.

Trying to do this with Rules or some type of trigger is very complicated. Some Views contrib can rotate content but it's really only for slide shows and the like...

Since Scheduler is already picking dates in a standard way, how hard would it be to support repeating dates?

Comments

Hi,
A simple version of this could be done in scheduler, but whether it gets added depends on how well it fits with the rest of the scheduler code and whether we view it as an essential part of scheduling or just another 'great to have' option (there are lots of them already :-)

I could visualise how it could be done using a simple repeating pattern eg set the usual 'publish on' date & time and specify a number of hours or days for the repeated publication. You would likewise set an 'unpublish on' date & time but the same 'repeat duration' would be used. The repeat value could be added into the scheduler table as a simple number. Then during the cron run which does the publication, if a repeating value was given then a new row would be inserted into the scheduler table (or the existsing row could be updated) calculating the new date from the date just used. Likewise on unpublication. The difficulty would be in allowing things like 'every 1st of the month' because this requires more information to be stored in the scheduler table to allow the next publishing date to be calculated.

An alternative would be to allow multiple rows in the scheduler table, which would be inserted at the node editting time as is done currently. This has the benefit that the 'until' date could be specified and then all the events would be added to the table at one time. There would probably have to be a few tweaks to the logic in the cron function but that should not be too difficult.

So it comes down to whether other users, and more specifically the maintainer Eric, think that this is a useful addition to scheduler. This functionality is common in other calenders and mail programs, so it may well be good to include it.

I think a lot of the code needed to do this elegantly is already available. The Date module (http://drupal.org/project/date) has a Repeat API for creating a form element that will allow users to select repeat rules (any possibility imaginable) and store those selections in an iCal RRULE string. I imagine that this could be adapted to have the Scheduler module present the repeating form element and then store the rrule for its own purposes. Once the rrule is stored, Scheduler could then parse it to determine if the node should be published or not as an alternative to using the dates that are currently set manually.

The Date Repeat API also has a calculation function that will parse the RRULE and return an array of dates that match those rules. This could also be adapted for use in the Scheduler to help it determine if the node should be published or not.

Personally, I think this is a feature that would be accessible for non-technical users so it could end up seeing very wide adoption. I can imagine myriad applications for this but let me put it this way: Am I the only one that thinks that automatically publishing and un-publishing the "Happy Holidays" message on the site every winter is an edge case application? Have you actually tried setting that up that kind of thing using Rules?! Ugh.

My primary application for this right now is that I need to remind clients of upcoming annual events and holidays to promote seasonal purchases, so I want to set a schedule for each one and have the ones that are currently relevant appear on the home page. Currently there's no out of the box solution for doing anything like that.

I'd love this functionality, it's exactly what I'm looking for as I'd like to add an ubercart product to my drupal site that is only on sale at certain times of the day during the working week. Is it likely that this could happen?

Hey Mark, don't be frustrated. New features are almost always filed against the latest branch (currently 7.x), but provided that a project's 6.x branch is still maintained these features have a chance of being back ported. If I were you though, I'd be looking to upgrade to D7 anyways ;)