README.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. DraggableViews
  2. ==============
  3. This module provides dragging entities and saving their order.
  4. Quick install:
  5. 1) Activate Draggableviews module at admin/modules
  6. 2) Navigate to view edit-page, click on the first link at the Format section and then choose style "table".
  7. 3) Click Add button at the "Fields" section and choose field "Content:title", add and apply.
  8. 4) Click Add button at the "Fields" section and choose field "Content:Draggable views (Draggable views)", add and apply.
  9. 5) Click Add button at the "Sort criteria" section and choose field "Content:Draggable views weight", add and choose sort asc, then apply.
  10. 6) Save the view and you're done.
  11. In the case of table standard drupal tabledrag.js javascript is used.
  12. We also support jQuery UI Sortable javascript. In order to use it please set display style HTML List.
  13. By default HTML list is displayed like grid. If you would like it to be displayed as list override
  14. CSS styles for example in following way:
  15. .draggableviews-processed li.views-row { float: none; width: 100%; margin-left: 0; }
  16. One view/display to set order another to display
  17. ================================================
  18. You can create one view to set the order and another view to display the order. Or even
  19. create one view with two separate displays. In a view that displays the order there
  20. should be no draggableviews field (that makes view sortable), then in the settings of
  21. the "draggableviews weight" sorting criteria there will be selectbox "Display sort as"
  22. where you can choose the source view of your weights. This is applicable when you use
  23. Native handler.
  24. Permissions
  25. ===========
  26. Please add "Access draggable views" permission to users who should be able to reorder views.
  27. Arguments handling
  28. ==================
  29. Every time we save the order of a view, current set of arguments are saved with order.
  30. You can see this in draggableviews_structure table "args" column. By default when we display order we use all
  31. currently passed arguments to a view to "match" arguments in "args" column. This means that we can create
  32. a view with contextual filter or exposed filter criteria and save different orders for different sets of arguments.
  33. We can also completely ignore passed arguments using "Do not use any arguments (use empty arguments)" option
  34. in Arguments handling of Sort criteria Draggable views weight. Be aware that in this case empty arguments set
  35. will be used. So you can set order for a view when no arguments passed and then whatever arguments passed,
  36. empty set will be used.
  37. Prepare arguments with PHP code is an option when you would like to alter arguments before they passed to
  38. "matching" with "args" column. For us this means that we can create for example several exposed filters,
  39. but pass values of only one of values of exposed filters instead of all of them (like we create two exposed
  40. filters: author and node type, but take into account for ordering only node type).
  41. Please be aware that in PHP code arguments are passed as $arguments variable and you should return array.
  42. Contextual filters are number keyed and exposed filters are name keyed.
  43. Contextual link "Order view"
  44. ============================
  45. If there is view with sort order draggableviews weight and the order is set by another view we show "Order view"
  46. contextual link for opening a view that sets the order.