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.

CommentFileSizeAuthor
#5 filter-dnd.patch2.04 KBCrell
#1 filter-dnd.patch1022 bytesCrell
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

Status: Active » Needs work
FileSize
1022 bytes

So 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?

RobLoach’s picture

Yeah, 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.

quicksketch’s picture

This 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.

Crell’s picture

Title: Add drag and drop to rearrange input formats » Correct DnD docs and add drag and drop to rearrange input formats
Assigned: Unassigned » Crell
Category: feature » bug
Status: Needs work » Needs review

Thanks 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.

Crell’s picture

FileSize
2.04 KB

As I said, the attached patch...

RobLoach’s picture

Status: Needs review » Reviewed & tested by the community

Very slick!

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

I 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.