Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Currently, the node title is the only part of the node content that is displayed when ordering nodes with Nodequeue.
If the nodequeue ordering interface was a Views style plugin, then people could display any Views-support field from the nodes being ordered.
This would be a great way to create image galleries, and open up possibilities for new ways of using Nodequeue.
Comment | File | Size | Author |
---|---|---|---|
#25 | draggable_nodequeues.zip | 9.27 KB | beeradb |
#15 | draggable_nodequeues.zip | 7.54 KB | beeradb |
#6 | draggable_nodequeues.tar_.gz | 4.65 KB | beeradb |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedJust want to note that features in the following issues could be implemented with this feature:
#371695: Thumbnails from Image module show up in nodequeue
#299111: Display CCK fields while manipulating a queue
#340800: SmartQueue for Views
Comment #2
xjmTracking.
Comment #3
EndEd CreditAttribution: EndEd commented+1
Comment #4
MamaGubs CreditAttribution: MamaGubs commented+1
Comment #5
g76 CreditAttribution: g76 commented+1
Comment #6
beeradb CreditAttribution: beeradb commentedHere's a tar of a submodule I've written to handle this. This still needs a bit of work to be commitable, but I think it's a strong start. This is particularly well suited for gallery needs, i.e. reordering a video or image gallery which is contained in a nodequeue.
After installing the module, here are the steps you'll need to go through to get a working view.
To create a draggable view:
Add a page display, and get crazy with some reordering madness. As I said above, my use case is definitely dragging around images, so if you try it with other fields and get less desirable results, let me know.
Some things which need to be improved:
So that's where we're at. I'm probably not going to have a lot of bandwidth to mess with this for at least a few days, so if others want to run with it for a bit then I say go for it.
Just in case anyone has problems getting a view setup for this, here's an export of my local view for comparison:
Comment #7
ezra-g CreditAttribution: ezra-g commentedI still need to code review this, but responding to your list of things that need to be improved:
> * The javascript needs some work. In particular, it needs to be refactored to allow for multiple of these > on the same page. I've already started namespacing the views in the Drupal.settings array.
This would be great but is something that's not supported by the current drag&drop interface. I don't think it should prevent this from being committed.
> * The javascript needs to be updated to correctly use the start_at variable that's being set in
> Drupal.settings. Currently it doesn't do anything with offsets (think paged views).
Same as above.
> * We need some additional validation to make sure we are never losing nodes etc. This is unlikely, but
> definitely possible given the current code.
Yikes. I'll take a closer look to see why but yeah, let's not lose nodes ;)
> * Currently the position and sqid variables are hardcoded into the submitter. We should be passing
> either those values or the view in $form_state['storage'] so it uses the configurations that are set.
Definitely.
> * Absolutely positively needs tests.
Again, this shouldn't prevent it from being committed :).
Comment #8
ezra-g CreditAttribution: ezra-g commentedAlso, awesome -- Thanks!!11!!!
Comment #9
beeradb CreditAttribution: beeradb commentedI should also note, that even though this issue is tagged as 7.x, the current code is a 6.x module.
Comment #10
beeradb CreditAttribution: beeradb commentedA couple other thoughts I had on stuff that will need work here.
Validation is the big one, at this point I'm basically trusting people build their view correctly. We should be performing the exact same validation that nodequeue_save_subqueue_order on the reordered subqueue and presenting the appropriate messages to the user on failure, or perhaps patch nodequeue so those checks happen in an API function, which we (and nodequeue_save_subqueue_order) call. Additionally, we should add in checks to make sure only one sqid is present in the result set, and flag a validation error if that's not the case. As is, the submitted grabs the first sqid it finds, and just assumes that's the subqueue it's working with. Without this check in place nodes could be arbitrarily added to subqueues.
Neither of these are difficult tasks, but I'm making a note here so they don't fall off the radar.
Comment #11
izmeez CreditAttribution: izmeez commentedsubscribing, this will be very cool.
Comment #12
hatsch CreditAttribution: hatsch commentedthis sounds amazing! this might open great further possibilities.
Imagine a two column page. one column holds the nodequeue, the other column holds another view with exposed filters or built with search_api. one can easily drag nodes from the "search view" to the "nodequeue view".
this would be a major enhancement for building nodequeues.
Comment #13
chrisschaub CreditAttribution: chrisschaub commentedWondering if you ever did more with this? I can get it to reorder, but only the first item sticks. So, only ordering sticks for the first item in the list. The lower items position doesn't save.
Comment #14
chrisschaub CreditAttribution: chrisschaub commentedOk, this issue is this line:
$('.draggable-nodequeue-sort-field', this).val(index + 1);
which will work fine if you drag "down", but if you drag "up", then we need something like:
$('.draggable-nodequeue-sort-field', this).val(index - 1);
Comment #15
beeradb CreditAttribution: beeradb commentedThat line is actually correct. It loops over all of the LI's in the list and sets the subqueue position to index + 1, meaning the first element will be position 1, second element 2, etc.
I've done a bit more work on this. Kinda got lost in the fray of rushing towards Alpha on the project I built it for.
Either way, I think I've listed all of the current known issues (which are fairly minor) so there's nothing holding this back from getting a more extensive review/feedback to see if there is anything in addition to the issues I've outlined.
Here's the latest version I've been working with - it has a handful of improvements including a more stable submit handler (should not have any chance of losing nodes anymore) and better support for nested li's (I was running into an issue when adding 'remove' links to draggable nodequeues).
Comment #16
chrisschaub CreditAttribution: chrisschaub commentedCool, but the ordering isn't working for me when I drop it upwards. What version of jquery ui are you using 1.6? I should clarify, when I drag the link upwards to the first position, it doesn't stick. It works when I drag down, but not up. After I click save, the order is gone. I was looking at the refresh call in the jquery for sortable? It's odd that it works down, but now up in the order. I am on a mac tho, but Firefox.
Comment #17
beeradb CreditAttribution: beeradb commented@schaub123: Are you still seeing that behavior with the latest version I uploaded?
I was having some issues with things sporadically not saving previously, but that should be fixed in the latest version as I'm not seeing that bug anymore. I actually forget the details of what the cause was, so I'll have to look up commit history to see what change was made.
Let me know, and thanks for testing!
Comment #18
chrisschaub CreditAttribution: chrisschaub commentedYes, I downloaded and tested, still same issue, If you drag an item to top of list, it doesn't stick. Only when you drag downward below current position. I'm using latest drupal 6 jquery ui 1.6. Thanks, cool module. I'll start debugging a bit.
Comment #19
beeradb CreditAttribution: beeradb commentedif you can paste a views export and/or a feature to show what your setup is, I don't mind taking a look. I'm not seeing that behavior at all on this end.
Comment #20
chrisschaub CreditAttribution: chrisschaub commentedI'm just using your view. Can you tell me what version of jquery and jquery_ui you are using? It might be jquery_ui and the sortable method. I've tried on firefox, safari and chrome on mac osx.
Comment #21
beeradb CreditAttribution: beeradb commentedjquery v1.3.2 via the jquery_update module, jquery_ui version jQuery UI 1.7.3 via the jquery_ui module.
Comment #22
chrisschaub CreditAttribution: chrisschaub commentedahh, it's probably the jquery 1.7.3. the sortable interface changed radically in 1.7 from 1.6. i'll check that
Comment #23
chrisschaub CreditAttribution: chrisschaub commentedOk, that did it. Make sure when you release this cool module, you mention that jquery update 2.x and jquery_ui with 1.7 are required. Would not work without jquery 1.3.x. Thanks!
Comment #24
beeradb CreditAttribution: beeradb commentedAwesome -- glad that got ironed out. I had actually forgotten we were even using jquery_update or I would have mentioned it :)
Other than that, are you seeing any strange behavior? let me know after you have a few minutes to play with it.
Thanks!
Comment #25
beeradb CreditAttribution: beeradb commentedNew version. Adds support for specifying a CSS class for a drag handle, also properly respects the "hide from display" flag in views.
Comment #26
delykj CreditAttribution: delykj commentedsubscr
Comment #27
karljohann CreditAttribution: karljohann commentedSubscribing. Are there plans to make this an official module or adding it as a sub-module to Nodequeue?
Comment #28
karljohann CreditAttribution: karljohann commentedI'm not getting this to work. I've tried everything I can think of, Views2 and 3, Jquery 1.2, 1.3.2 and 1.5, jquery ui 1.6 and 1.7, three seperate themes (including Garland) and almost every combination of the above.
What happens is that I can re-order the nodes but they won't stick once I've hit save. I've followed the instructions above and tried various other things but they won't stick. Only thing different is I'm using node titles to re-order and not images.
Any help would be greatly appreciated!
Comment #29
karljohann CreditAttribution: karljohann commentedOne thing I noticed is that the module calls for ui.widget and ui.mouse. Neither one of these files are in jquery ui 1.7 or 1.6 so the files are not found.
Comment #30
hatsch CreditAttribution: hatsch commentedanything new on this? this feature would definitly be a major enhancement!
is there a chance that someone would pick up a bounty?
i'd chip in the first 100 euro
Comment #31
ezra-g CreditAttribution: ezra-g commentedIt sounds like this patch needs work.
This would be a huge improvement to providing a better and more flexible Nodequeue UI.
To help move this forward, it would be great if someone could review this patch and address the feedback from #28 and above.
Comment #32
earthangelconsulting CreditAttribution: earthangelconsulting commentedany hope for a 7.x version of this?
Comment #33
jenlamptonChanging status from NR to active since it doesn't look like there's a patch to review yet, or even a 7.x version of the module to adapt. Great work though by @beeradb, it shouldn't be too hard to start from this D6 module.