Hi,
I've created a simple block with custom php that lists all the 'page' content on a site that links directly to the edit tab for each page. I was initially using views, but it is so simple I just did a custom php block.
However, I'd like some flexibility in ordering the items in the block. For a normal menu that appears in a block, one can use the Drupal table drag handles and reorganize that menu.
Is there any novel approach to give me the best of both of those worlds? In other words, put dynamic items list in the block via custom php, but still manual-goodness of being able to arrange the items?
I know it sounds a bit of a tall order, but maybe there is something clever I am missing.
Thanks,
Comments
I think you are not missing
I think you are not missing anything. If I understand you correctly, you have some PHP code that fetches node ID's and otyher node information from the tables and then create a list of these items as links. You are the one controlling the ordering in that case. Even if you could somehow add the drag-and-drop capabilities, how would your code know that a new order of items is needed the next time it runs?
Paul Kemper
Tauros Marketing ICT
http://www.tauros.eu
yeah
you got the scenario right. Yes, I know it sounds hard, given that I'm choosing the order programmatically, but just thought I'd throw it out there. I want the best of both worlds I guess.
I was just hoping for a clever solution. For example, menu items have weights that are stored in the db, so if there were some way to order my nodes by their weight, and then have some way to use the menu ordering gui to let the user manually drag around the rows to set the weights.
So I guess what might work if there was some way of making a 'php-menu' and faking the system into thinking that the menu was static instead of dynamic. Then Drupal would present you with a menu editor where dragging the items would set node weights, and then you could add the menu to a block.
or something.
Views Bulk Operations to the rescue?
This sounds like an application for Views Bulk Operations, which changes the view output to add widgets for editing.
It does this by adding a 'display type' to the list of display options in the view. (Other examples of displays include Page, Block, RSS, etc)
I dont know if VBO supports drag and drop reordering, but this is definitely the way to do it.
Adjunct: I am currently considering writing a gantt chart output plugin for views that would add a 'gantt display' using Event start/end dates and some metadata about event dependency. I would be interested in learning how to write a views display plugin with you.