backdrop-contrib / draggableviews

Makes Views draggable
GNU General Public License v2.0
3 stars 2 forks source link

DraggableViews

This module provides dragging entities and saving their order.

Quick install:

1) Activate Draggableviews module at admin/modules. 2) Navigate to view edit-page, click on the first link at the Format section and then choose style "table". 3) Click Add button at the "Fields" section and choose field "Content:title", add and apply. 4) Click Add button at the "Fields" section and choose field "Draggableviews: Content", add apply. 5) Click Add button at the "Sort criteria" section and choose field "Draggableviews: Weight", add and choose sort asc, then apply. 6) Save the view and you're done.

In the case of table standard Backdrop tabledrag.js JavaScript is used.

We also support jQuery UI Sortable JavaScript. In order to use it please set display style HTML List. By default HTML list is displayed like grid. If you would like it to be displayed as list override CSS styles for example in following way: .draggableviews-processed li.views-row { float: none; width: 100%; margin-left: 0; }

One view/display to set order another to display

You can create one view to set the order and another view to display the order. Or even create one view with two separate displays. In a view that displays the order there should be no draggableviews field (that makes view sortable), then in the settings of the "draggableviews weight" sorting criteria there will be a selectbox "Display sort as" where you can choose the source view of your weights. This is applicable when you use the Native handler.

Step by Step Guide for Creating a New View with 2 Displays:

1) Activate Draggableviews module at admin/modules. 2) Create a new view

*Things to confirm after you saved your new view.