Drag-and-drop Content Ordering


I recently wrote a views plugin for the weight module which allows the setup of views which are a drag-and-drop form for ordering nodes.

The weight module is a module which stores numeric values instead of the usual 1 or 0 for a node's sticky status, which allows admins to assign specific weights to nodes, controlling their position on the default drupal /node homepage, forum listings or other views which are ordered by sticky status. You choose which content types will be weight-enabled, and then when you edit those nodes you can assign a weight from a dropdown.

Zivtech has been collaborating here in Philadelphia with Bluecadet Interactive on a number of projects. Bluecadet does excellent Flash sites and I have been helping them set up Drupal for content management on these sites (which I will blog about shortly). One of their common needs is to allow administrators to manually set the order of content such as playlist items or photos in a gallery. Their needs are close to what nodequeue does but they don't want to manually add content to a queue and they wanted to customize the administrative experience. They liked the idea of using drag-and-drop to allow their admins to order content directly from an administration view. By persuading our friends at Bluecadet that true views integration would pay off in the long run as opposed to a quicker but inflexible site-specific solution, I got the pleasure of creating something of true value.

Using the new Views 2 API and Drupal 6's core drag and drop ability, I was able to extend weight module so that we can create drag and drop ordering forms using views. Moving functionality into views creates enormous power and possibility, as fans of views know well. Please help by reviewing or improving my patch to get this views integration included into weight module.

Ready to get started?

Tell us about your project