Order as text, manage huge trees with your favourite code editor

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
kari.kaariainen's picture

Drupal has powerful tools, like draggable views, for managing hierarchical trees, but when the number of rows exceed, say a few hundred, draggable views may become a bit cumbersome and slow. Moving several hundred of rows from one place to another or indenting or unindenting them etc. can be hard or it can even be impossible due to the memory consumption of the browser.

I've created a small module for my own use, which offers the titles of the whole tree in a form textarea field as tab indented text, which I can copy-paste to my favourite code editor and use its ability to move, indent and unindent hundreds and thousands of rows easily. I can then paste the edited text back to the form and hit save. The module then takes care of reorganizing all the nodes of the big tree.

I don't know if the use cases for this would be numerous or rare. I could imagine that someone managing something like a scientific taxonomy or large product database could use this.

What are your thoughts, would this be of use to someone?

Comments

I'd find it useful. Is it

no2e's picture

I'd find it useful.

Is it possible for menus, too?

Could be. I haven't thought

kari.kaariainen's picture

Could be. I haven't thought of that.

blockadminlight

donquixote's picture

You might want to have a look at blockadminlight (D6 only) for inspiration.
It does not support trees, but it has a nice fancy effect with jQuery caret, if you put the text cursor somewhere.

http://drupal.org/project/blockadminlight

It also has an algorithm to find a smart column width, if plain text is to be presented in two columns. It does not use the length of the longest row, but instead a balance to make the column not too wide, while not cutting off too many rows.

Thanks. I tried that, without

kari.kaariainen's picture

Thanks. I tried that, without the plugin though, but yes, that is same kind of an idea. That lead me to this:

http://mjsarfatti.com/sandbox/nestedSortable/

Something like that might replace tabledrag in the future, maybe with added functionality that would match code editor's ability to select rows and move them around etc.

Well, after multiplying the number of rows to over thousand in Chrome Dev tools the browser beginned to choke. So I guess any fancy graphical UI would be a liability.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week