I have a view with Draggable field attached. The view has some arguments (published and one taxonomy).
My second view is using the sort criteria of Draggable views weight Display sort as set to the first view.
The problem is that the second view is not sorting as it should and I'm sure this is because of the arguments handling.
Both the "Use all agruments" and "Do not use any arguments" show different results and both are not the same as my first view.
I wonder if and how the arguments are supposed to be working and is this currently possible at all?
Or maybe I should use the "Prepare arguments with PHP code" option? I don't know what I should return there and what PHP variables are available in this field?
Comments
Comment #1
ygerasimov commentedI think the best way to understand how arguments work -- look at database table draggableviews_structure. There you can see in arguments column json encoded arguments saved with a view. When you set in your weight settings arguments handling you define how this column will be joined. If you set in both views "Do not use any arguments" they should work together as value in that field is always empty.
Hope this helps. Please advise if you still have problems with this.
Comment #2
philipz commentedOK this is clear for me now. I need the first (administrative) view to use the arguments for ordering because it's per taxonomy order. Otherwise I understand I'd need to order all the items in one long list (1000+ items) and this would be one way to do it without arguments. This is not usable in this case (I'm using it in another one though :).
So now what I need to get is the right arguments in the second view. Those can be provided by PHP or by Contextual filters views interface as I understand.
Can you give me an example of using a taxononmy argument and published argument with "Prepare arguments with PHP code" field?
Also how would I set the Contextual filters to achieve this? I'll try returning values with PHP for contextual filters and I guess it would be correct way to do this.
Comment #3
philipz commentedI've played a bit with "Prepare arguments with PHP code" and after looking through draggableviews_join_handler.inc I've come with a solution for taxonomy argument. This view is used on taxonomy/term/x pages and on the from page - that's what the default tid is set for:
Comment #4
ygerasimov commentedThanks for sharing. Closing this issue.