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?

Comments

murz’s picture

StatusFileSize
new2.99 KB

Here 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.

murz’s picture

murz’s picture

StatusFileSize
new2.25 KB

Updated 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.

ygerasimov’s picture

In 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

murz’s picture

Can 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?

ygerasimov’s picture

Status: Active » Fixed
StatusFileSize
new45.09 KB

First 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.

murz’s picture

Ok, thanks, I find this! All works well. Will be good to see examples about this in readme.

ygerasimov’s picture

onelittleant’s picture

Is 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.