Custom ordering using drag and drop
I'm writing an alternative front page for a site using Drupal 7. Using the hook_node_(insert|load|update|etc.) functions I can manage an extra table to hold the 'weight' of the node (a simple integer which can be used to 'order by' with db_select so that I can control the display order).
So far, so good! But what I really want to do is add in the functionality that can be found for ordering items that the Block page uses (http://lll.mysite.com/admin/structure/block) an then save the weights to the extra node information table that I have created.
I know there are various modules available to do weight ordering but I really want to write this one myself as their are other factors I need to keep control of.
Is there a video on this in another section or can you point me in the right direction?
Cheers,
Martin.
This is a quite challenging task, and to my knowledge there is no video dedicated specifically to it.
The central pieces of the puzzle are: form elements of type 'weight', a custom theme function to present the form as a table, and drupal_add_tabledrag() function. Perhaps the best chance to get an idea of how these pieces come together is taking a look at the tabledrag_example.module from Examples for Developers project.