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.
By HixField on
I have defined a content type that includes a custom field called index
. That gives the index
position to show the item in the total list of items (aka a sort of weight
). How can I use Drupal Draggable Views to update my custom index field in my content whenever I drag the item to a new position?
It is important that is my custom field index
because I am reading the content out of Drupal using the json:api module
Comments
Please, provide more info
1. What is the name of content type that has the 'index' field?
2. What is the name of the view?
The content type represents
The content type represents an "Package" (nothing todo with any drupal or other package!) and contains the following other fields:
I'm displaying this in a table, and would just like the option to drag it around and then update the index field:
Here is the solution with the
Here is the solution with the custom code. In the example the draggable view name is the 'packages_order' and the display is the 'page_1'.
Thanks a lot! I have never
Thanks a lot! I have never programmed in php before (was hoping for a contrib module) but I have experience with development and php I will have a look at your code. Thanks!
without submitting a form get draggable view weight field value
Hello, how can I get the draggableview weight field value and save it to content field called "field_priority" ? I have a custom developed module using which use to search FAQs from the front-end. Without reloading the page.
https://drupal.stackexchange.com/questions/312392/save-draggableview-weight