I've created a tabbed extension for betterselect. Other than adding some new classes in PHP to what betterselect already does, it's completely driven by jquery and jquery_ui. The idea here is that with a LARGE taxonomy, even betterselect can be a pain to use. My extension moves root terms, and their sub-trees, into tabs. This code is currently in a separate module, but I wanted to see if there was an interest in integrating it directly into betterselect. If not, I'd release as a separate module that depends on betterselect. Please see attached screenshot.

Comments

Flying Drupalist’s picture

This is awesome, but can you make it vertical tabs instead? I think for some of us with a lot of root terms that's even better!

But in any case please release the module and talk about merging later! :D

rwohleb’s picture

Since I'm just using the jquery.ui.tabs plugin, it should just be a matter of theming. I'll look into it.

I have to address an IE6 issue, but then I'll release it.

Mark Theunissen’s picture

rwohleb, I'm one of the maintainers of Better Select, and your work looks great! Depending on the complexity of the code and it's suitability for inclusion, I am open to integrating it.

Thanks! ;)

Mac Clemmens’s picture

+1 Nice Work

aschiwi’s picture

Do you have any news on this? I need exactly what you have in your screenshot. I'd love to test your code and improve so it can be included in betterselect.

rwohleb’s picture

I've moved my code into a sandbox for everyone to access. Keep in my mind I haven't touched this code in years, so I'm not sure how well it works any longer.

http://drupal.org/sandbox/rwohleb/1113804

aschiwi’s picture

StatusFileSize
new24.18 KB
new1.52 KB

@rwholeb: wow thanks for putting that code up!

I have found another solution in the meantime, which makes no changes to the betterselect module. Our solution is a js file in a feature module.

We are also using a bunch of patches:
- http://drupal.org/node/1111840 (code style improvements)
- http://drupal.org/node/1111604 (betterselect per vocabulary)
- http://drupal.org/node/510012#comment-4153600 (jquery update compatibility)

I am attaching our js file and a screenshot of the resulting better select tabs. We managed to get rid of the hyphens and hid the check box for the 1st level term.

The js file is being called in the .module file of our feature module:

/**
 * Implementation of hook_form_alter().
 */
function tmrc_recipe_form_alter(&$form, &$form_state, $form_id) {
  if (($form['#id'] == 'node-form' && isset($form['taxonomy']))) {
    // Initiate rewrite of betterselect checkboxes.
    jquery_ui_add('ui.tabs');
    $path = drupal_get_path('module', 'tmrc_recipe');
    drupal_add_js($path .'/js/tmrc_recipe.select.js', 'theme', 'footer');
    drupal_add_css($path .'/css/tmrc_recipe.theme.css');
  }
}
rwohleb’s picture

The code I put into the sandbox does not make changes to the better select module. It's a new module that just overrides parts of better select theming as well as add a JS file.