Short20142 min854×480

Drupal7-RulesComponents-ViewsBulkOperations-SetCreatedDate

Brylie Christopher Oxley

About

A brief recipe describing how to create a bulk action to update content created dates. This recipe uses the Rules and Views Bulk Operations modules.

Transcript

I have a view of randomly generated articles I'd like to be able to change the post date on multiple articles without having to edit them individually. To do this, I will rely on two additional modules: Rules, including the Rules UI and Views Bulk Operations.

In order for Views Bulk Operations to integrate with Rules we have to create, what are called, Components. Components are simply re-usable rules.

I'll add a new component, in this case I'll just add an Action Set. The action set will be called "change post date". It's affecting Articles, so I'll go ahead and add a tag of "articles".

The component can take variables. In this case, I'm going to pass in a node, labeled "article", and I'm going to ask the user for a date.

We'll need one action performed inside of this [rule] and that will be to "set a data value" on the article created date. For the "data value", I will switch to "data selection mode" and allow the end user to specify a post date.

That's it, the changes have been saved. I'll navigate to my view for articles. I'll add a new field. Right up top is the "Bulk operations" for content. I'll label this "operations". Down here you can select "change post date". And I'll save the view. I'll navigate to the articles view.And now there's an operations select box, including my "change post date".

In the checkbox column on the right side, I'll select several articles. [Use] my "change post date" operation. I'll simply change the year. Lets post these in 2012. It's going to confirm, perform the process on the selected items.

Now, scrolling to the bottom I see I have three articles published in 2012.

Archive
Wikimedia Commons, in Wikimedia Commons
Licence or status
CC0, as the Wikimedia Commons states it.
Rights statement
Creative Commons Zero, Public Domain Dedication
Credit
Brylie Christopher Oxley
Who can watch
The archive gives no rating. Invisible Network shows it to Teens profiles and older, judged from its collection and subjects. How films are placed