When approaching new Drupal projects, I’m always excited to listen and learn about the project’s requirements. It’s an occasion to create just the right solution. With a recent project, I took the opportunity to rethink the use of Nodequeue to manage front page content, and instead used the Draggableviews and Custom Publishing Options projects. Before diving into that solution, let’s step through other solutions to manage front page content, so we can understand the pros and cons of each.
Using Drupal’s 'Promoted to Front Page’
Let’s imagine a project that requires promoted front page content of various types. This includes time-sensitive promotional content displayed within a banner slider, and below the slider, we want to display a row of elements promoting primary services or products. Additionally, on the front page, we will want to promote other curated content of different types and display them in their own fashion.
Out of the box, content authors can promote any node content to the front page with a tick of a checkbox. Using a combination of view displays, site builders can combine the ‘promote to front page’ view filter with the content type filter to group appropriate content together, and then organize these view displays using the Panels or Context to display them on the front page.
All good, right? Well, from the site builder’s perspective, this seems like an elegant solution. It’s only when a content author or other editorial staff interact with it that we realize it's a bit abstract and too general. In other words, when a content author creates or edits content, regardless of content type, they see this single checkbox, 'Promoted to front page'. This option is not explicit about where this content will appear on the front page. It’s only when a content author can combine their working knowledge of Drupal and the site’s front page, would they fully understand what 'Promoted to front page' means for any particular content item/type.
Now that we have front page content, how is it sorted and how do content managers control the position of content with the banner slider or lists? You may find yourself relying on view sorts to control the sort order of your content. In doing so, you may find yourself manually updating content post dates to gain granular control of the content’s sort order. If you are looking for something more intuitive, then keep reading!
Once you determine you need more granular control to manage the front page sort order, manually updating post dates notwithstanding, you may find yourself reading " Comparison of Node/Entity Ordering Modules”, a Drupal.org community documentation page. Of the modules listed on this page, you may gravitate toward these two popular projects: Nodequeue and Draggableviews.
Using Nodequeue to manage front page content
The Nodequeue project allows users to organize nodes into a set or queue and provides a drag-and-drop interface to arrange the nodes in your preferred order. Combine this with additional view displays, and you can create front page panels or blocks to display content in your desired order.
Using the Nodequeue project has it’s distinct advantages to organize and sort content.
- Simple setup; just enable, create a queue, and use the automatically created view.
- Queues can contain nodes of different types.
- Easily add and remove nodes from queue.
- From a Nodequeue administration section and queue pages.
- From the tab on the node path.
- From optional node links.
- Can configure maximum number of nodes within each queue.
- Integrates with views bulk operations.
- Separate permissions and interface to manage queues separate form the node add/edit form.
All in all, the Nodequeue project is an excellent solution to manage many node lists for a complex project, where content authoring and editorial responsibilities are decentralized. As turnkey solution, it’s often a go to solution for many developers for all projects. However, for less complex projects, the separation between editing content and managing Nodequeues on a separate tab may more functionality than in needed.
Using Custom Publishing Options and Draggableviews to manage front page content
To create an alternative to Nodequeue’s complexity for the content author, you can combine the Custom Publishing Options and Draggableviews projects to provide a more focused solution to manage Drupal front page content.
One benefit of using this solution is tighter integration with Drupal’s existing publishing options. As seen in the screenshot below, each custom option is added to the ‘Publishing options’ vertical tab on the node add/edit form. By adding the options here, it becomes clear if content is published, and, with careful naming, it’s clear to where the content is published. Also, you can create unique custom publishing options per content type to better target each type' use case.
Similarly, custom draggableviews administrative view pages can be configured to better integrate with the existing content overview page. This brings these task together in the back-end, making them more accessible.
I won’t spend much effort here detailing how to set these two projects up together. Custom Publishing Options is straight forward once enabled, and Draggableviews has a detailed documentation page. To summarize, you can create two view displays, one view page display with draggableviews to manage the sort order and another view display to render the output on the front page using the draggableviews weight order sort. To ensure these views only include the content flagged with your custom publishing option, you simply add your custom publishing option as a view filter as seen here.
Now, there are some downsides to this solution when compared to the more robust Nodequeue solution. For starters, you can not clearly limit the number of nodes with a maximum queue size. Also, it does not work well with many different queues. You can imagine how cluttered the node form’s ‘Publishing Options’ vertical tab and the administrative section would become with many more options, not to mention the additional time needed to build each new administrative view.
Last but least, Nodequeue’s ability to separate the permissions and interface from the node add/edit form allows distinct user roles to have separate touch points when editing or promoting content. Although Custom Publishing Options provides unique permissions for each option, a user will need both this permission and appropriate node permissions to edit this setting within the node add/edit form.
Use One or the Other, maybe Both
As you may know, there is always more than one Drupal way to solve a problem. Depending on the project’s complexity and editorial needs, any of these solutions may work well, and I wouldn’t rule out the possibility of using all these tools on the same project.
Although I’ve written specifically about using these tools to manage front page content, they can be used in many different contexts throughout a Drupal site. I’ve worked on projects that employ 30 or so nodequeues to manage lists of content within different site sections, and I’ve also combined Draggableviews with the Flag project to allow users to sort their bookmarked or favorite content. Leave a comment and let me know how you use these tools.