Using Rules to publish/unpublish based on a Date field in Drupal


At /admin/config/workflow/rules/components/add

Create a “Action set”:
Name = Unpublish Content
Variables:
Data type = Node
Label = Node
Machine name = node
-Continue-

Actions:
  Node > Unpublish content
  Data selector = node
  -Save-

At /admin/config/workflow/rules
Create a “rule”:
Name = Unpublish Rule
React on event = Node > After saving new content
Restrict by type = your content-type
-Save-

Conditions:
  Content is published
  Data selector = node
  -Save-

Actions:
  Schedule component evaluation
  Component Value = Unpublish Content
  Scheduled evaluation date data selector = node:field-your-node-date-field
  Identifier value = Unpublish content ID [node:nid] ([node:title]).
  Node Data selector = node
  -Save-


2 thoughts on “Using Rules to publish/unpublish based on a Date field in Drupal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s