1

I have a generic content which can be differencied by a taxonomy term. Then i've created to views filtered by a taxonomy. I want to enable a second filter, exposed , based on the taxonomy, depending on the first filter also bases on the taxonomy but not exposed.

For example: I have the following taxonomy: Type :

  1. News
    1. First
    2. Second
  2. Publication

    1. Third
    2. Fourth

    My content is 'Article' and the Type is 'News > First' In my View 'News', I can only see the content News ( First or Second), this part is easy. What I need is an exposed filter where i can only choose First or Second from News depending on the fact that I'v already done a previous filter based on the first level of this taxonomy.

How can I do that?

Thanks

  • Not quite following what you want, but you might want to consider 2 faceted filters perhaps, given your need for state of one choice affects the second, "drilling down" webwash.net/tutorials/… – therobyouknow Dec 18 '13 at 13:49
3

You can achieve this by combining Simple Hierarchal Select and Views Dependent Filters. So you use SHS for selecting the taxonomy term, and then set a dependency that if a term is selected on the first taxonomy, show the second taxonomy.

  1. Add your first/primary taxonomy that you will be using to determine the secondary options. Don't select any terms, expose filter.
  2. Add your secondary taxonomy, expose filter.
  3. Add a Global: Dependent Filter to your list of filters.
  4. Your Controller Filter is the first taxonomy that will be deciding which second field/taxonomy will showing up.
  5. The Controller Values are the values from the taxonomy selected for the Controller Filter. Pick the term which when selected will show the dependent taxonomy. The dependent filter is the secondary taxonomy that you want to show up.

There does need to be some specific ordering going on, like the dependent taxonomy needs to be above the Dependent Filter, but I can't remember exactly. I'm sure you can figure it out from there.

  • It looks like what I need, but I can't see where I set the dependency of a term. – Jeremy Dec 18 '13 at 16:49
  • I updated my answer, that should be more thorough. – kyletaylored Dec 18 '13 at 19:22
  • Thanks for the Answer. I was using the "[Hierarchical Select][1]" module and both my client and me found a fatal bug that was breaking the module functionality (changing root categories breaks the widget functionality). So i used "[Simple Hierarchal Select][2]" module instead and i had no problem with it. [1]: drupal.org/project/hierarchical_select [2]: drupal.org/project/shs – ANDiTKO Jan 2 '15 at 18:53

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.