displaying a nodequeue on your site

Barry Pretsell's picture

You may think that you just need to go to admin/build/block in order to add the nodequeue as a block to your site. That's not the case, first we need to enable the nodequeue in Views, so go to admin/build/views and you will see nodequeue_1 listed (ok, mine says nodequeue_2 well I did a dry run before writing this tutorial) with Title 'Latest Stories', notice how the Status is Disabled.

Admin Views

Click on the Enable link under the Actions column in order to enable it.

Now go back to admin/build/block and you will see the nodequeue listed under the disabled.

Admin Blocks

Select the region where you want it to be displayed and click Save Blocks button. (Note we can configure the block which will allow us to override the Title, and do all the usual things possible with Blocks permissions etc). You should now see the nodequeue appear as a block in your chosen region.

Showing the nodequeue as a block

So now we have a Block on the site which lists the content of our nodequeue, we can manually add and remove Story nodes from the queue. But what happens when we eventually have more than 5 Story nodes on our queue? The oldest story will disappear from the queue and we'll have a more link displayed at the foot of the block.

more

Also, if you inspect the nodequeue the In queue column will show 5 and the words QUEUE FULL.

nodequeue - queue full png

Before we use Actions and Workflow modules, a few observations about nodequeue:

  • Once an item falls off the queue, ie. we exceed the maximum number of queue entries, then if you edit that node the link will once again say Add Story.
  • Adding a node to the nodequeue causes the added node to be placed at the bottom of the queue. It then rises to the top as more nodes are added. By default the sort order of the nodequeue is by queue position, which you'll see when we make a view of a nodequeue. A Latest Stories block really should have the newest added nodes added at the top of the list and sink down the list rather than rise. But have no fear, Views module comes to the rescue as we will see we can add a view of a nodequeue and do all the usual view things.
  • You can use the Theme Wizard in the Views module to theme the nodequeue, YEAH! See below
Theming nodequeue

Let'smake a view of our nodequeue, so we can make the Latest Stories block list stories by the time the Story node was created.