One thing I have learned is that it’s very hard to describe; Drupal modules. They often have to be seen to really understood, and a lot of what I write is hard to see because I like to write APIs and tools that let administrators have Phenomenal Cosmic Power without having to write much PHP.
As a result, it’s hard to tell what my modules do. I wrote this description of the Node Queue module and I’m hoping this might help people understand both what it does, and why many sites need something like this.
The idea behind the Node Queue is simplicity in administration, yet flexibility in presentation. It provides a 'queue', which is really just a list of nodes, and an easy way to add/remove nodes from the queue. It also provides a mechanism to re-order the queue arbitrarily.
The way I use this is that i create a 'Featured Content' queue. I can assign the queue a size limit; so let's say I make it 5 (just picking the number at random). When I add a node to the queue, it goes into the back of the queue.
When I add another node, it goes to the back of the queue, and the original node I put in moves toward the front. I can display these nodes front to back or back to front, and it's typical to display them back to front, so you get the most recently added.
Once I've filled the queue with all 5 nodes, the next one I add will 'pop' the front one out of the queue, and it will no longer be featured content.
It's great for things with a queue size of one, if using a 'lead article' type thing, where one particular article is called out on the front page.
It also has Views support, so if any of the default ways to look at a queue aren’t what you want, create a view. Use Jeff Eaton’s Insert Views module to put the view in your page or dashboard nodes.
A primary setup for the Node Queue is a dashboard, with a couple of Node Queues. The first queue is called the ‘Lead Article’ queue, and it’s a 1 node queue. The top section of the dashboard displays that queue in teaser mode, giving the classic CNN-style lead article. In the left side of the dashboard we put the Featured Content queue, which is 10 nodes long, and it just lists titles. Because it’s a node queue, the featured content is arbitrary, and the administrator can trivially re-order the content. In the right side of the dashboard we put the ‘Recent Comments’, ‘Recent Articles’ block. Or maybe we put Recent Poll. Or maybe we put lots of these and let the user scroll.


Post new comment