I've tried a zillion different methods in my template.php in order to make the Taxonomy Super Select checkboxes fieldset appear uncollapsed, but couldn't find the proper syntax. Has anyone managed to do this from within template.php ?

Thanks.

Comments

talino’s picture

I posted that question on August 14th. Nine DAYS later and a zillion ^ 2 attempts later I fiinally got it to work. Easy when you figure it out. Here are the details in case a newbie such as myself stumbles, hopeless, upon this post:

1. It only works if you code your own module. It's easier than it sounds and tutorials are everywhere. You only need a couple of files with about 5 lines of PHP in each.
2. Figure out the content types on which you use Taxonomy Super Select. These will be referenced using CONTENT-TYPE-NAME_node_form. Assume article_node_form for the following.
3. Figure out the Vocabulary ID you are displaying. In my case, that's the '1' at the end of the link for editing the vocabulary itself: admin/content/taxonomy/edit/vocabulary/1.
4. Add the following to your module:

<?php
function YOURMODULE_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) { // We might need to alter other forms in the future, so this helps.
    case ('article_node_form' || 'document_node_form'): // Article and Document are custom content types. I use TSS on both.
      $form['taxonomy'][1]['#collapsed'] = FALSE;
      $form['taxonomy'][1]['#collapsible'] = FALSE;
      break;
  }
}
?>

5. The above will work only if your custom module is evaluated after Taxonomy Super Select. The best way to ensure that (from what I've learned) is to change its weight in the database. Using PHPMyAdmin, Sequel or any MySQL editor, go to the system table and change the weight of your module to a value higher than TSS. My had TSS set to '1' and my custom module set to '0'. I modified the latter's value to '100' just to get my revenge for all the hours I've wasted getting this to work.
Enjoy.