Free Website Tips

I read a lot of website advice every day. The best of that advice I wish everyone knew. Brainstorm! Let's put the greatest advice in quick tips. Usually I see a really good tip every few weeks. Remember to act on the tips - they are short so it should be easy.

Recent Twitter Posts

    Clients Include

    United Nations

    Center for Interpersonal Effectiveness


    Coram Deo Consulting Group


    Benchmarx

    Some Magic Required: Getting DraggableViews to Work

    How can you make the first first and the last last?  Often clients need to order their Staff or Board Member or ... pages so that it appears in a specific order.  It isn't usually a point of pride, rather it just makes sense for the board President to be listed first so people can tell who is in charge.

     

    This seems like it would be easy, but the only out-of-the-box way to do it is have them enter in a number for each staff member and then sorting on that.  Trouble is that is far from intuitive and leads to headaches like - "I already have entered 1 through 17 and now I need to add someone new in position 3, do I need to re-enter 3-17 as 4-18."

     

    Fortunately, DraggableViews comes to our rescue!  It is a super handy module that allows clients to drag-and-drop into the order they want.  However, it can be a bit tricky to initially configure.

     

    So, without further ado, here is my cheatsheet for setting up DraggableViews for this sort of situation:
    1. Download DraggableViews (http://drupal.org/project/draggableviews)
    2. Enable both DraggableViews and DraggableViews CCK Handler (otherwise the "Save order" button won't do anything)
    3. Add the Weight field (using Number CCK module Integer field type) to your content type (and possibly populate it to prevent repeatedly getting "The structure was broken. It has been repaired." messages).
    4. Create your View and set the Sort to be your CCK Weight field Ascending.
    5. Change the view Style to "Draggable Table" and set the options there accordingly (choose CCK for handler).

    Oh and remember when you're done to set the View access to only specific roles!

    Running into more issues?  These and more covered at http://drupal.org/node/393530