Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently in Draggableviews 8.x-1.x you can only get views to write to its own "native" table (draggableviews_structure). In 7.x-2.x you had the option to use the FieldAPI. I also attempted to test the weight to each entity, but failed because of the limitation of drupal 7.x (TODO: add issue link here). Drupal 8.x was extremely more promising.
This will probably not go into 8.x-1.1, but might be a candidate for 8.x-1.2, if I get time to write this. Any help would be appreciated.
Comment | File | Size | Author |
---|---|---|---|
#5 | draggableviews_support_handlers_2909599_5.patch | 11.26 KB | brunodbo |
Comments
Comment #2
mpp CreditAttribution: mpp as a volunteer and at AmeXio commentedUsing the Field API and supporting the weight module would be great!
Comment #3
brunodboI started porting Flag weights to D8 because of its integration with DraggableViews (see #2934789: Port Flag Weights to Drupal 8, so (I think?) I'm going to need this as well. Happy to try and get started on this, but could use some pointers. Is there anything in the D7 version I could look at as a basis for this?
Comment #4
brunodboI had a look at how this is done in the D7 version. Looks like we would have to:
- Add a
draggable_views_handler
class, containing aget()
andset()
method, that other modules can extend.- Add subclasses for native handling of storing weights, and one to support Field API fields.
- Allow users to configure the handler in the DraggableViews field form in the Views UI.
- Then in
draggableviews_views_submit()
, we pass off the saving of weights to the handler class.This is all assuming we follow the same approach as in the D7 version. @iStryker, is that what you had in mind?
Comment #5
brunodboAttached patch is work in progress, not yet functional.
It implements a
DraggableViewsHandler
plugin type, along with aDraggableViewsHandlerNative
plugin. If you apply the patch, and go to the settings form for the DraggableViews views field, you should be able to see the native handler as an option.The native handler plugin doesn't work yet (it currently just contains the code from the 7.x native handler plugin), that's the next step. After that we can implement the Field API handler plugin, and the Flag Weights one (over in the Flag Weights module).
Comment #6
4kant CreditAttribution: 4kant commentedWe are using field api plugin in several drupal 7 projects where we have individual sort criterias for similar lists of nodes.
Would be great to have this feature in D8/9 again.
Thanks!