Very often need to have 2 separate view display - one for display to anonymous, and other - for changing order via admin user.
At now we can use only FieldAPI handler for set order to other display, but it is too slow on saving many items.
Another way is add to Native handler feature for duplicating new order on save to other displays. So we will can change order in admin views display and display items via this order in other display for anonymous. For do this, we can add new field into DraggableViews field settings, in which we can select other current view displays to which we want duplicate order.
And in function set($form_state) add saving data not only for current display, but also for additional from field settings.
Is this way possible?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | display_sort_as_selectbox.png | 45.09 KB | ygerasimov |
| #3 | draggableviews_1499200_3.patch | 2.25 KB | murz |
| #2 | draggableviews_1499200_2.patch | 2.25 KB | murz |
| #1 | draggableviews_1499200_1.patch | 2.99 KB | murz |
Comments
Comment #1
murzHere is quick patch that add described earlier functionality into draggableviews module.
It adds "Additional displays for populating order" item into draggableviews display field options, in which you can set additional display ids, that will duplicate order of items from current display.
Comment #2
murzFixed version, removed part from issue #1493586: PHP Fatal Error: Call to a member function build() on a non-object in draggableviews.module on line 169
Comment #3
murzUpdated version of patch, textfield replaced to select with list of all displays for current view.
Here is screenshot of new settings: http://wstaw.org/m/2012/03/25/plasma-desktopc21821.png
And updated patch near.
Comment #4
ygerasimov commentedIn the display view in settings of the sorter you can choose where to take sorting order from. So if you have view1 to set order and view2 to display. There is no problem to set view2 to show sorting order of the view1 (only condition is that display of view2 should not have field draggableviews). Hope this solves this issue.
If not, please advise the use case when we need to save sorting order for several views at the same time
Comment #5
murzCan you describe more where and how I can get view1 order for view2?
I must search this in "Sort criteria" fields, in "Format - Table - Settings" or in other place?
And another example - I have view1 and 2 displays - display1 for set order, display2 for view ordered list.
How I can set order for display2 from display1?
Comment #6
ygerasimov commentedFirst of all make sure that view2 does not have field draggableview added. Then add Sort criteria: Draggableviews weight. In its settings you will see "Display sort as" selectbox where you can set the "source" of your order. Screenshot below.
Same goes for two displays of one view. Make sure that display 2 doesn't have field draggableviews (sot it is not sortable). Then you will have "Display sort as" selectbox in settings and would be able to set a "source".
Please feel free to reopen this issue if have any problems.
Comment #7
murzOk, thanks, I find this! All works well. Will be good to see examples about this in readme.
Comment #8
ygerasimov commentedGreat! I have updated documentation http://drupalcode.org/project/draggableviews.git/commit/90b6815
Comment #9
onelittleant commentedIs this functionality going to be committed to the 2.x branch? I did not see a patch corresponding to the screenshot in your response. This is precisely the functionality that we could use as well.
UPDATE:
I was unable to see the display selection in the sort handler because of the way my view was built.
I have a page display of table fields for sorting content.
I have a block display of content teasers.
The page display was the default display, so even though the block didn't use the field display, it had the draggableviews field, which prevented me from using a different display order when configuring sorting on the block. I had to change the block to a field display, override fields, remove the draggableviews field, then change the block back to content teaser view.