I have a Drupal 7.31 installation.

I have 3 rows in homepage, in which are listed 3 articles for each of them. Here a partial screenshot of Edit View for the first row, in which Sort criteria actually is set to "Publishing Date".

enter image description here

My customer asks me to be able to directly re-arrange the order and I found something about the "DraggableViews" module. I tried to follow two guides (DraggableViews and Custom Sort Drupal Content with the Draggable Views Module) without success.

Reasons are both:

  1. Options and settings that I found in my installation are different from which are listed in tutorials
  2. In both cases, I have to change "Format" in "Table" but doing so results in a wrong display template also in the website, corrupting layout. So I have to remain with "Unformatted List" for output.

It's not important that custom order is made with Drag&Drop, an order specified with dropdowns could be ok, but how to not affect view display, but only order?

  • Check for the weight module; it could help. – Math666 Apr 24 '15 at 9:50
  • I read about needs to set "table" format to use it (the same as with DraggableViews). As I said, I need to mantain "Unformatted list" as output format – Luca Detomi Apr 24 '15 at 9:54

You can maintain a weight field with list option enabled for your content type and sort your view from your weight(an integer). In views sort criteria section put the weight criteria top if there are any others. Same answer I gave here

You could try the Node Queue Module, which will allow you to completely control what shows up in your view and in what order.

Basically, you add a nodequeue, add your three pieces of content to the queue and set the order. The nodequeue can automatically create a view for you (configurable), which you can then customize any way you want.

I've used the Weight module and definitely prefer node queues.

  • I can recommend using NodeQueues as well. We've had many clients using the queues to control content and it's order on landing pages, homepage, etc. It's relatively easy to understand also for non-technical person, it's drg&drop and autocomplete for adding content to it. What's a bit confusing for non-Drupal person is the name 'queue' - so they many times expect the content would disappear from the queue once the queue is saved - might be worth explaining :-). – David Lukac Apr 24 '15 at 12:23
  • Thank you. I'm working on a website not developed by my agency so there is not any documentation or someone to ask "why" he did something in some way..... You're speaking about customizing a newly created view but I'm afraid about needs to change actual code. I would like to simply work on Drupal configuration to activate a different sorting method on existing items and not re-style their output.... can you understand my fears? :-) – Luca Detomi Apr 24 '15 at 12:44

I (also) highly recommend using the Draggable views module – and since it can actually be a bit difficult to get the first steps going here's some basics that should help:

  • Configure your (fields) view as you like. Be sure to add the field Content: Nid to the list and check Exclude from display on the next screen.

  • When you're done clone that view and set the Format of the clone to table. I usually name it the same as my fiest view and append a "_sort" to the name to that I know how is who. This will be your client's interface to sort the entries.

  • Add the Draggableviews: Content [Provide a draggable functionality.] to the list of fields to your _sort-table and then rearrange the fields' order so that the draggable field is first in the list.

  • Add Draggableviews: weight to the sorting criteria of both views. Choose your _sort-table under Display sort as to connect them.

This is basically the workflow i use everytime I install a sortable list view. I actually use quite a lot of them. Even for 'events' etc. draggable views can make sence since sometimes the client e.g. wants the "current" event before the "upcoming" event, even though that woudn't be in coreect chronological order. Anyways – I hope I didn't miss any important details.

You use a separate view to organise the order of your nodes. So create table view to organise the view and link this view to the management menu and give the view a URL like admin/structure/yournameofview (this will appear under the structure menu for your client)

Once you have organised your nodes, go back to your “live” view and apply the draggable weight to the sort order.

You may need to create a relationship for this to work.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.