Active
Project:
DraggableViews
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2012 at 10:42 UTC
Updated:
10 Aug 2016 at 14:37 UTC
Jump to comment: Most recent
I have the "Domain Access" Module (http://drupal.org/project/domain) installed but sorting works only on the main domain.
When I change the order on a 2nd domain it´s ignored.
It would be awesome if multiple Domains would be supported.
Meanwhile I have to create a extra view for every domain.
Comments
Comment #1
ygerasimov commentedI have implemented Field API handler that can save weights of the nodes to integer fields. Hope this will do the job for your case.
Please reopen this issue if you need to make Native handler working for domain module.
Comment #3
ericmulder1980 commentedThe Field API Handler is a nice addition to the module but i don't think this will provide a solution for the use case mentioned in the OP. Perhaps if i describe the use case in more detail it will be more clear what is needed for this to work.
Take a website that has the domain_access module installed and has two active domains; domainA@example.com and domainB@example.com. On the website there is a content type news that can be published to domainA, domainB or both domains. When a news node is published to both domains you want to be able to set a different sort value for both domains. For example, a news items should be the first on the list for domain A but last on the list for domain B.
I guess the best option is to write a custom Domain aware handler that stores the sorting in the same way as the native handler but has an extra column to store the domain. As i am currently working on a project that needs this i will throw in a patch somewhere this week to be reviewed.
Comment #4
ericmulder1980 commentedPerhaps there is even a simpler solution to this. I see in the native handler there is an option to use the hook_draggableviews_handler_native_arguments which let's you pass in your own arguments. This makes it easy to include the domain_id for which you want to add the sorting. I'm not sure however how to implement this within the view.
Comment #5
ericmulder1980 commentedI found a solution and will share it here for others to benefit from.
Implement hook_draggableviews_handler_native_arguments
First thing you need to do is implement the hook to supply additional arguments to draggable views. In my case i need to add the domain_id of the current domain.
Arguments handling
In both the sortable and sorting view you need to alter the sort criterion configuration. Most likely this is the "DRAGGABLEVIEWS: WEIGHT" sort handler. In the section Arguments handling select the option "Prepare arguments with PHP code" and put the code below in the configuration.
Happy sorting!
Comment #6
ericmulder1980 commentedModified this issue to a documentation task because i feel more people would benefit from some documentation based on this use case.