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.
When you edit an input format, you have the option to rearrange its items. As it is right now, you just set the weights and then save them. It would be neat if we had the drag and drop stuff for that as well.
The menu item is available at admin/settings/filters/%filter_format/order.
Comment | File | Size | Author |
---|---|---|---|
#5 | filter-dnd.patch | 2.04 KB | Crell |
#1 | filter-dnd.patch | 1022 bytes | Crell |
Comments
Comment #1
Crell CreditAttribution: Crell commentedSo I tried my hand at this, using the documentation in the docblock for drupal_add_tabledrag(). Unfortunately, while I can get the weight field to be hidden it doesn't show the drag icon, so you can't actually reorder anything.
Quicksketch, could you point me toward what I'm doing wrong here?
Comment #2
RobLoachYeah, that's strange. You seem to be following the documentation exactly. I even tried to stick the filter-order-weight in at the filter_admin_order() level, and it resulted in the same thing.
Comment #3
quicksketchThis is a very easy change to make, but I want to step back and wonder if this is a good usage for drag and drop. I tried this out myself right after blocks went in, but I'm not sure drag and drop is helpful.
When I first got started in Drupal, looking at input formats I figured that some of them shouldn't be messed with considering the weight of 10 given to things like HTML Cleanup. Removing the weight fields also removes that sort of inline suggestion about where filters should be placed.
So I think I'm totally down with drag and drop here, let's just make sure we give the end user some kind of help on what default weight filters suggest.
Comment #4
Crell CreditAttribution: Crell commentedThanks to quicksketch, I was able to identify the problem. The table row needs to have a class of "draggable", which is not currently documented.
The attached patch therefore has 2 parts:
1) Adds that documentation to the docblock of drupal_add_dragtable().
2) Now successfully implements draggables on the filter ordering page. It also leaves the weight column shown, so that on first view you will still see that HTML Cleanup has a weight of 10 or whatever.
Dries/Gabor: Chunk #1 must go in, as it's an important documentation bug. #2 I leave to you to rule on either way.
Comment #5
Crell CreditAttribution: Crell commentedAs I said, the attached patch...
Comment #6
RobLoachVery slick!
Comment #7
Gábor HojtsyI think filters are equally good for drag and drop, and users need to debug filter ordering on their own, so I committed this patch, thanks.
Comment #8
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.