Are there any documentation notes as to how to program the views global dropbutton?

Currently I can get the Edit/Delete links there, but what I would like also is an Unpublish, and a link to toggle a Boolean field.

Accepted answer

Hi @onyx

There are a couple of options for unpublish.

The former is more simple and I've just ported it.

The latter has granular permissions per content type.

I don't think you can change a boolean field with a drop button but if you install the Views Bulk Operations then you could add an action to change that.

Most helpful answers

Thanks @onyx. Corrected the link and the usage.  Feel free to do a PR for the additional View instructions.  I could add it, but I would rather there is credit where credit is due.

Comments

Hi @onyx

There are a couple of options for unpublish.

The former is more simple and I've just ported it.

The latter has granular permissions per content type.

I don't think you can change a boolean field with a drop button but if you install the Views Bulk Operations then you could add an action to change that.

Excellent work, thanks! I've tried url_unpublish out, and works nicely.

Your link above has some extra garbage at the end of it. Also there is an extra apostrophe in the usage example.

For anyone else wanting this to work in a view:

  • add the nid as a field, but exclude it from display
  • rearrange the nid to the top
  • add a field global: custom
  • build a link as per the docs :    <a href="/url_unpublish/[nid]">Unpublish Node</a>

 

 

Thanks @onyx. Corrected the link and the usage.  Feel free to do a PR for the additional View instructions.  I could add it, but I would rather there is credit where credit is due.

No worries bro. No credit required.  Just  happy to help. When I get the time I'll figure out how use your new module together with a global button for views, and I'll send the details in the issue queue. Thanks for your work!