开发者

Drupal: Custom "Action" Button for nodes On a View

I have a view listing different "task" nodes called "available tasks" I wish to have a button for every listing that will enable the user to assign the "task" to themselves. My "task" node has a 开发者_运维问答user reference field called "assigned to". So all i need is a button next to every "task" node in my "available tasks" view clicking on which will set the user reference field "assigned to" of the "task" node to the current user. If any one can point me in the right direction; it will be greatly appreciated. Thanks


I would recommend the Views Bulk Operations module. With that you can add a 'Display' to your view, then set its 'Style' under 'Basic Settings' to 'Bulk Operations'. Assuming you already have a 'Page' display on your view which lists out your content, then you can attach the new VBO display to your page.

You will need to configure your VBO display to allow 'Modify node fields', then choose your user reference field from your content type as the field to modify.

When that is done, save your view, then navigate to your page. You should then see a checkbox next to each item in your view, and a button that will allow you to bulk modify the user reference field on whichever nodes are selected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜