Automatically displays a "not yet published" message whenever viewing an unpublished node.

Page showing "This page is not yet published" warning

When viewing an unpublished node, it is not immediately obvious that the node is unpublished. Sure, you can click on the "Edit" tab, and scroll down to view the vertical "Publishing options" tab to see if the node is "Published" or "Not published". But that is a bit of a hassle if you're dealing with a lot of nodes, and you just want to be alerted to the fact that the node your viewing is not published. This module therefore displays the message "This page is not yet published" every time a node which is not published is viewed. This makes it trivially easy to know the status.

Module Justification

It's easy to look at this module, particularly if you look at the code and see how little it actually does, to question whether it is needed as a module.

It is principally aimed at site builders; if you are a developer, you can easily do this yourself. However, if you are a site builder and want just this functionality, then no matter how little code this module contains, if you are not able to do it yourself, you cannot.

If you are a developer and are concerned about performance having a separate module just to do such a small thing, then by all means take the code and drop it into a hook_node_view() in your own module. Personally I think there is an elegance and beauty about being so minimalistic. Though if I felt it was causing any performance burden I wouldn't hesitate to bundle the code into a larger module.

Module History

I am working on the French language website, Lingopolo. I work with several others remotely in the setting up of pages: a girl to do the recordings, another to put together the different parts of each page. I wanted to introduce the idea of a page being in a draft stage before being published, so that I could ensure that all the elements on the page were correct before being published.

I looked at the following two modules designed for setting up an editorial workflow:

I installed and tried out each one in turn.

The Workflow module seemed a little less sophisticated, but definitely more actively maintained; the last commit was only 5 days ago at the time I'm writing this (1st May 2014).

The Workbench module seemed much more architecturally well thought out, though much less active in support (the last commit being 7 months ago).

When comparing them I also read various articles comparing them. One I found particularly interesting was the Move Over, Drupal Workflow … Workbench Moderation Does it Better article. What the author there says about the "Published" flag being handled much better with the Workbench module seemed particularly true. This clinched it for me: I decided to go with the Workbench module.

Unfortunately, even though I tested well with my own userid (admin), there was a major issue when being used by the content editor roles. Basically the autocomplete fields which were being used by the content editors to find other nodes were not seeing any more the unpublished nodes. This was a complete nightmare, and made the content management unusable.

In addition, the content editors were finding the new workbench tabs unnecessarily complex. It's true that for my use case, it was a bit overkill.

Maybe the problem is not with the Workbench module. Maybe it's with the code for doing the autocompletes. Nonetheless, with the added complexity too, I decided to revert to simply having nodes in either "published" or "not published" state, but defaulting nodes on creation to be in "not published" state.

The problem soon became obvious though that when viewing a node I didn't know whether it was published or not. Having to keep going into "Edit" and checking was a pain. So I added this little message to make it blatantly obvious to me when I was on a node which was not yet published.

Originally I wrote the code as part of another module I had, but I love it so much that I thought it might be useful as a module it its own right for other people to use, so I've now put it in its own module so that anyone can use it (especially site builders, who may not be able to write the one line of code needed).

Project information

Releases