9

I'm working on a site that needs bulk tagging on nodes. The D8 core View Bulk Operations Port is "simple" (https://www.drupal.org/node/1823572) and it doesn't have "modify entity values" which I used for this user-case in D7. There isn't a D8 tagged version of contrib VBO I can find.

My specific use-case is I need to bulk tag groups of blog posts with single terms. I have bulk imported around 2000 nodes from wordpress and need to apply new tags to them. Once the backlog id tagged I don't really need bulk editing any more. (But I'm sure many folks have similar use cases, like bulk editing fields or tags that aren't one-off tasks)

Actions is part of Core so it might be possible to write custom actions for my use case (Tag node with taxonomy term X, Y or Z). This documentation seems the most promising. https://www.drupal.org/node/2020549

Can any confirm this is best way to bulk-edit nodes or is there a different approach that I should consider?

4 Answers 4

7

Drupal core doesn't provide this functionality, so yes, you need to implement it yourself.

Yes, you can implement your own action plugin to do this. You can also have a form to select which tag you want to apply. Have a look at the node delete action plugin, which uses a confirmation form, but you can implement whatever functionality you want in that form.

Keep in mind that Drupal core is missing another important feature for your use case. The ability to apply a bulk action to more than one page. The best you can do until there is a port of the contrib module to provide this to increase the amount of rows per page, so that you need to repeat it fewer times.

1
4

Berdir's answer is accurate, you must write your own action.

I found this article extremely useful to quickly achieve this.

Basically when you create and registering a new action you can specify a 'confirm form', eg 'Are you sure you want to do this?'. You can provide a form for this stage that accepts more information and then uses that information to perform a batch operation on the nodes/entities who's IDs have been passed through.

Note that, as Berdir stated, the action to perform a bulk operation across multiple pages is still (to my knowledge) missing.

1

views bulk operations (https://www.drupal.org/project/views_bulk_operations) gives a special views field that will allow you to bulk change fields

bulk_update_fields also promises exactly that. Its a new module for drupal 8 and seems to work with some warnings (in my case)

you can install it stand alone and go to content/node and use it as action bulk update fields to another value or if you have view bulk operations installed overriding content/node path you can edit the view and there will be a new action available (which will need to be enabled)

0

Today, for taxonomy, it's possible via Taxonomy Bulk Actions (TBA) contrib module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.