by Jeff Eaton on February 18, 2013 // Short URL

Module Monday: Publish Button

It's a simple problem, but a serious one. You've put your content editors in front of Drupal for the first time, and they can understand the node form without any problems. They understand taxonomy terms, grok menus and node references… but they get nervous when it's time to save their work. "Will... will this be published as soon as I click 'save?'" Normally, there's no good way to make the distinction between saving and publishing a piece of content explicit. Site builders can set a content type to be unpublished by default, then give editors the broad "administer nodes" permission, but that's clumsy solution that forces editors to dig for what should be a simple action: publishing or unpublishing a post. That's where the Publish Button module comes in.

Screenshot of settings screen

With the module installed, every content type gets a simple new checkbox: "Use publish/unpublish button." Once it's selected, users with appropriate permissions get a new, Publish, on the node edit form. It unambiguously flips the node's "Published" flag and saves it. If the node is already published, the button reads (predictably) "Unpublish." Site builders can set up fine-grained permissions around who can and can't publish and unpublish content. Setting posts to be unpublished by default, then enabling this module, can give the Drupal content creation workflow an almost WordPress-esque simplicity.

Screenshot of the resulting change to the node form

Because Publish Button is so simple, there's not much to say about how it works. You set up the permissions, activate it for the appropriate content types, and you're ready to go. It won't solve all of your content workflow problems -- it makes no provisions for scheduled publishing or detailed review of revisions, for example -- but it's a clean, quick solution to the uncertainty that comes from Drupal's one-size-fits-all "Save" button.

There is a Publish Button video on Drupalize.Me which shows how to use this module.

Jeff Eaton

Senior Digital Strategist

Want Jeff Eaton to speak at your event? Contact us with the details and we’ll be in touch soon.

Comments

eaton

Draft vs. Publish

I haven't used SaveDraft module for a few versions, but if I remember correctly it operates on a similar but not-quite-the-same principle. It allows users to save unpublished drafts of articles in addition to the normal "fully published ones."

Publish Button instead emphasizes the idea of publishing or unpublishing a node as explicit actions. It works even if revisions are turned off for a given content type, and also makes it easy for users with sufficient permissions to take content down. It also provides explicit permissions like "unpublish own articles" and "publish all articles" to specifically control who can do what.

Both modules are similar, and I think it's just a question of which approach works best for your site's content editors.

Reply

valderama

I quickly tested both modules

I quickly tested both modules again on simplytest.me - and both are really similar. Safe Draft (http://drupal.org/project/save_draft) also just hides the publish checkbox and instead shows a Save and Publish button.

A draft is just an unpublished node.

The main difference between both modules is that Publish Button provides the option to activate its functionality by content type. This feature is available as a patch for Save Draft as well (http://drupal.org/node/1409000)

Also, Publish Button provides granular permissions per content type, whereas Safe Draft only provides one global permission.

However, if I got it right, both modules are so similar that probably a merge would be a valid option.

Reply

MiSc

Nothing against a merge

As the maintainer of Publish button I have nohing against a merge with similar projects, but I will not work on that one myself at the moment - but if somebody will work on it, it should be nice.

Personaly I like to keep things simple, and that is way the module was created from the beginning :-)

Also there are some other modules out there, like Publish Content, that also is similar, but not exactly what I wanted for my own projects.

Reply

cyberpunk

What probable should be done

The best thing for the community in this case is a comparison table between all the modules in the documentation somewhere.

Reply

Geijutsuka

Keep 'em coming

Thank you so much for continuing to bring to light these simple little interface modules that make a world of difference to the end-user! Many of the modules you've pointed out have become an indispensable part of my Drupal arsenal.

Reply