0

I am using Drupal 7, and I created a two-level vocabulary used it as a field for term reference. I created it using Simple hierarchical select module.

edit : I have my node tagged with both the parent(State field), and child (City field) term.

Location

 - State1 
   - City A
   - City B
 - State2
   - City C
   - City D

Then I have a page View, where I use the Location field as an exposed filter, so that visitors can sort the content.

I have no problem in getting the results when the user selects for example:

  • Illinois
    • Chicago

Then all content that has the term Illinois and Chicago will be displayed.

The problem comes when I only want to sort using the parent term, so if you sort for example using only

  • Illinois

It should display every node that has the term Illinois. But my Views returned nothing, when selecting only the parent term and applying that exposed filter.

I have checked that when you look view the taxonomy of Illinois everything displays properly, but not on the exposed filter in Views.

How will I proceed on displaying the nodes in my Views using exposed filters?

1

I have managed to work this one out.

Apparently you can add a filter using two methods:

  • "Simple hierarchical select"
  • "Content: Has taxonomy terms (with depth; Simple hierarchical select)"

Select the second method Content: Has taxonomy terms (with depth; Simple hierarchical select) as the filter.

Then after selecting the filter, you then have the option to select which taxonomy term to use. After that just select Simple hierarchical select.

Next step was to just simply expose the filter to users, so they can manipulate it.

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.