Nodequeue: Control the Order of Drupal Nodes
There are various ways to create lists of nodes in Drupal. So what’s different about the Nodequeue Module?
Nodequeue allows you to manually control the order of your nodes. You can use drag and drop to re-order a list of nodes. Whereas a module like Views will automatically publish all of your nodes that meet certain criteria, Nodequeue allows you to control the order of those nodes.
Nodequeue is very often used for slideshows and other site features where you need to choose which articles to show.
Step 1. Install the Nodequeue module
- Download Nodequeue or get the install link from http://drupal.org/project/nodequeue.
- Go to Modules > Nodequeue.
Two additional modules will be automatically installed under Nodequeue. Another will be under Development. The only essential one is Nodequeue itself if you are making simple lists. Smartque taxonomy allows you to create a list from a taxonomy and gives you the same control over it. You won’t need Nodequeue Service unless you are an advanced user and have a good understanding of services on Drupal.
There are some optional enhancements to the module available you can install if you need them.
- Smartqueue per-user: Makes a personal queue available to users of one or more roles.
- Smartqueues for Organic Groups: Makes a queue available for ordering by members of an Organic Group or Group admins only. If you’re using Organic Groups, you might be interested in this tutorial as well Organic Groups: Social Networking for Drupal.
Step 2. Enable Nodqueue Generate
- Go to Modules > Development.
- Activate Nodequeue Generate.
Step 3. Create a Queue
- Go to Structure > Nodequeues to access the module.
- Click Add simple queue.
Step 4: Configure the Queue
- Title: Featured Articles.
- Queue size: Enter 0 and there will be no limit on the size of the list. I limited it to show 5 articles.
Step 5. Choose Content Types for the Queue
- Check the box for the type of content the queue will contain.
- Click Submit to save your choices.
On our site we don’t have any administrator roles except for the super admin, so there is nothing to choose in that section. If you have roles, you will be able to assign permissions.
The queue has now been created. There are three ways to start building your list. We’ll show you all of them.
Method 1: Add Nodes to the Queue
- Click the Generate Queue Assignments tab.
- Check the box next to the queue you want to generate.
- Click Generate.
- Return to the List tab.
- Click View on the Featured Articles View.
- Hover over the drag icon and you can reposition your nodes.
- To the far right, you’ll see a delete link if you want to remove any from the list.
- Click save to make sure your new order is saved.
Method 2: Add Nodes to the Queue
The second way to add to the list is to type the exact name of the node into the field. You can skip clicking on the Generate Queue Assignments tab and enter the titles directly. Above shows the result of clicking the view link without generating a list first.
Be sure to save anything you add.
Method 3: Add Nodes to the Queue
- Click Nodequeue when in the content editing mode.
- Click Add queue.
Conclusion and Views
You have now created a list that can be reordered with simple drag and drop. But you’re going to want to show this list on the site. This is now easily done by using the Views module to create a view for display of the list. If you need to know how to use Views, we have a detailed explanation in our Drupal Intermediate Class.
Also, after you’ve created a nodequeue, go to Structure > Views and there should be a view named nodequeue_1. That will give you a big start towards integrating Nodequeue and Views.
DraggableViews is also a good module for sorting out nodes. In fact, I prefer to use Draggableviews than nodequeue nowadays. Worth introducing to the community.