Community Documentation

Scheduler: Automate Node Publishing / Unpublishing

Last updated May 17, 2013. Created by jonathan1055 on January 13, 2007.
Edited by mitchell, heather, Eric Schaefer, Vacilando. Log in to edit this page.

Scheduler module

Introduction

This module allows nodes to be published and unpublished on specified dates and times.

Dates can be entered either as plain text or via selection from a Javascript pop-up calendar via JSCalendar in Drupal 5 or Date module in Drupal 6 and Drupal 7.

Screencast

Here is a quick 5 minute screencast overview of enabling and using Scheduler. http://youtu.be/G7VfhGI4aoE

Installation

  1. Copy the scheduler directory to your modules directory.
  2. Enable the module, database schemas will be setup automatically.
  3. Grant users the permission "schedule (un)publishing of nodes" so they can set when the nodes they create are to be (un)published.
  4. You can also set the date/time format to be used in Administer -> Site configuration -> Schedule module settings.
  5. Visit Administer -> Content management -> Content types and select any node type and check the box "enable scheduled (un)publishing" for this node type.
  6. Check "Alter published on time" to alter the published on time to match the scheduled time.
  7. Repeat for all node types that you want scheduled publishing for.

Usage

For node types that have been enabled for using Scheduler the node edit page has an extra collapsible fieldset. In this you will find:

  • Publish on
  • Unpublish on

Publish on: Enter here the date that you would like the posting to be published. Leave this blank to disable automatic scheduled publishing. This is useful if you would like to make a posting published immediately but then unpublished at a later date.

Unpublish on: Enter here the date that you would like the posting to be unpublished. Leave this blank if you do not want the posting to be automatically unpublished.

Notes

  1. If you have JSCalender (part of the JSTools module) installed and enabled, then the publish and unpublish dates can be entered with the JSCalender pop-up (only Drupal 5 version)
  2. Scheduled automated publish and unpublish functions occur via the cron system so the actual, real world, publication times will be aligned to when your cron system runs. For example, if you enter a published time of 3:45pm but cron only runs once an hour on the hour then the real publish time will be 4:00pm and not 3:45pm.
  3. The creation time of the node will be set to the scheduled publication time if you enable "Alter published on time" in the content-type settings.

Comments

Just to clarify the above: to enable scheduler for a particular content type, you need to be on the edit page for that type. The relevant checkboxes are under "Workflow Settings."

See this screenshot, under this bug thread.

Hope this helps. :)

In Drupal 6, on my set-up at least, it shows up OUTSIDE of "Workflow", and beneath.

If you need to use a hook_form_alter() or hook_form_FORM_ID_alter() with this module, be sure to set the weight of your module to at least 1 using hook_install():

<?php
  db_query
("UPDATE {system} SET weight = 2 WHERE name = 'yourmodulename'");
?>

Need Drupal module or theme design? Please visit Webdrips to learn how we can help.

Page status

Needs updating

Log in to edit this page

About this page

Drupal version
Drupal 4.7.x, Drupal 5.x, Drupal 6.x, Drupal 7.x
Level
Intermediate
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.