1

I'm using views exposed filter, so the users can select a categories from taxonomy.

This is an example of the structure:

Category 1

-sub category 1

-- sub-sub category 1

-- sub-sub category 2

-sub category 2

Category 2

-sub category 1

-sub category 2

The problem is some of the sub categories has a same name, so for the user it's hardly to recognize which sub category belongs to specific category. I'm trying to style with CSS the main categories in one color and sub categories in other, but with firebug I don't see a way how to do that. Is there any option or feature for Views exposed filters? So far I've tried with better exposed filters module, but it does not have any option for that.

2

You need each subcategory in a separate opt-group.

There is a thread about adding support for that here: Support optgroups for taxonomy selection list.

The thread includes a patch that can be applied to give this functionality.

There is also a module called Taxonomy container that looks like it also does what you want (image from module page):

enter image description here

I would also recommend the chosen module to further improve the select and allow additional styling changes (it converts the select to a UL).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.