0

Working on my first Drupal project, I meet this problem for the second time. I can't figure why this happens and couldn't find any leed on the web.

1) A view with contextual filter Content: Has taxonomy term ID (with depth)

  • depth = 1
  • When argument not in the URL = Show all results
  • Vocabulary : the proper (hierarchical) taxonomy is selected

The view has path taxonomy/term/%

The preview is correct, both when entering as an argument a child term ou a parent term.

The view results are correct for any taxonomy/term/[child_term] path.

But for a taxonomy/term/[parent_term] path, I get a message "No content tagged with this term". The sentence is true, but it should return all content tagged with any of the child terms. So, it behaves as if there was no (with depth).

2) Adding to the same view a basic Filter criteria = Content: Type(=[TheRightContentType]).

The preview is ok. But again, the results are not filtered. Even when the argument is a child term, I get all results tagged with that term, but whatever their content type is.

I flushed the browser cache. Then I flushed Drupal's caches. In vain.

Any suggestions appreciated. Thanks.

5
  • Have you tried increasing the depth?
    – Andy
    Commented Aug 1, 2014 at 11:11
  • No term has depth greater than 1 :-) And again, the preview gets the correct result !
    – amuli
    Commented Aug 1, 2014 at 17:53
  • Oh yeah, good point. Maybe a silly Q but are you sure it's actually using your View when you go to that page?
    – Andy
    Commented Aug 1, 2014 at 18:08
  • The view is called either from the main menu (path taxonomy/term/1/1) or from a menu whose block is in the sidebar (paths taxonomy/term/<tid>/1).
    – amuli
    Commented Aug 4, 2014 at 16:06
  • Not so silly a Q, Andy ! In fact, some links in the block menu had a path missing the trailing /1, providing the depth argument for the second contextual filter. And indeed, the view wasn't called. Thanks a lot :-)
    – amuli
    Commented Aug 4, 2014 at 20:30

1 Answer 1

0

Finally, the view has

• a path taxonomy/term/%/%

• a second contextual filter Content: Has taxonomy term ID depth modifier

and this solves problem 1 : with a parent tid as an argument the view produces every content that is tagged with one of its child terms.

But problem 2 remains.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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