Unpublish nodes intuitively with Rules and Views

Create a rule set and add an argument to receive from your view

There are numerous ways to clean up old posts. Node Expire + Rules is one way, however it requires the user to specify an expiration date, another module, and in that sense is neither intuitive nor efficient. Using Rules and Views together via rules + views integration there’s a great way use the data that has already been entered.

For the video folks here’s your 2 minute rundown of what is up:

1) Create the rule set to handle the data. Add a content argument – you’ll be passing the node ID’s over to Rules for the actions to take place

2) Inside the rule set add a rule – no conditions are needed, just add the action to unpublish the nodes

Here's what your final rule should look like

3) The final rule should look similar to the image at right

4) Once you’ve got your rule set up it’s time to create the view that will send information over to the rule.  Assuming you have rules + views integration and Views Periodic Execution installed you’ll now be able to execute your views on a cron tab

5) In views you’ll need to set the periodic execution phase, the rule set, and of course set up your filters as per usual and MOST IMPORTANTLY include the NID (so that rules knows which nodes to act on)

Select your rule set and pass the node id for your argument

6) The Views Periodic Execution mod by Stephen Jones aka darthsteven

Set the periodic execution phase

7) and of course you need to choose the rule set unto which the little nids may argue and achieve action.  Once you pick your rule set the available arguments’ll appear – any fields you have elected to have appear in your view are available to activate the rule.

Create a rules executor view and send it to your rule set
This entry was posted in Planet_Drupal and tagged , , , , , . Bookmark the permalink.

9 Responses to Unpublish nodes intuitively with Rules and Views

  1. BarisW says:

    Did you try Node Scheduler? Might even be easier ;)

  2. Ngwu says:

    Maybe i like Node Scheduler. thank for your detail guide :)

    • alibama says:

      different tool for a different use case — node scheduler is is fine for what it does though

  3. cheatsjungle says:

    I like Node Scheduler, using it for a year or so and I’m very satisfied. Thanks for the guide!

  4. Jovan says:

    Thumbs up for Node Scheduler. This is awesome guide. Thanks alibama!