This project is not covered by Drupal’s security advisory policy.

Drupal Canvas is a visual page builder for Drupal. This module adds a Scheduled component to it. Put any block or component inside it, choose a publish date and an unpublish date, and visitors only see that content between those two dates. Nobody has to remember to come back at midnight to add or remove a banner.

Features

  • One wrapper that works for both blocks and single directory components (SDCs). The module does not change what is inside, so each keeps its own settings.
  • Both dates are optional. Set only a publish date to start showing content later, only an unpublish date to stop showing it, or both for a window.
  • Editors can still see and edit scheduled content in the Canvas preview. On the live page, the schedule applies to everyone, editors included.
  • Dates are read in the site's default timezone, not the timezone of the editor's browser.
  • The cached copy of a page is cleared when a date passes, so visitors do not keep seeing the old version.

Typical uses: a seasonal banner, an event announcement that goes live on opening day, a closure notice that removes itself, a campaign block with a fixed run.

Post-Installation

There is no settings page.

  1. Enable the module.
  2. Open a page in Canvas and add the Scheduled component from the component library.
  3. Drag the blocks or components you want to schedule into its Content slot.
  4. Select the Scheduled component and set the Publish date and Unpublish date in the right-hand panel. Leave one empty for an open-ended schedule.

The timezone comes from your site's regional settings (Configuration, Regional and language, Regional settings).

Additional Requirements

  • Drupal core 11.3 or later, with the core Datetime module.
  • Drupal Canvas 1.12 or later (developed against 1.12.0).

None are needed.

Similar projects

  • Scheduler publishes and unpublishes whole content items. This module schedules individual parts inside a single Canvas page.
  • Block Scheduler and Schedule Block add dates to blocks placed in Drupal's Block Layout. They do not apply to Canvas components.

At the time of writing, we found no other module that schedules individual Canvas components.

Supporting this Module

Bug reports, patches and merge requests are welcome in the issue queue.

Community Documentation

Documentation and a demo will be added here as the project grows.

Good to know

  • This hides content when the page is rendered. It is not access control. The scheduled content is still stored in the page data, so do not use it to protect sensitive information.
  • In the Canvas layers panel, the wrapper adds one level of nesting. Nested Scheduled components must all be inside their window for the content to show.
  • Canvas date fields do not store the editor's timezone. The module reads the time as typed, in the site timezone, and ignores any timezone suffix on the stored value.

AI disclosure

AI was used to help develop this module and its documentation.

Supporting organizations: 

Project information

Releases