0

I'm stuck on something. I have a view with a path with a wildcard "/the-register/%". I would like to use the contextual filter, to filter on taxonomy term id or name. But when i add a contextual filter "Taxonomyterm-ID" with a fixed value 1, it's showing up nice in the preview, but when i go to the page it self it does'n show anything?

I'm using drupal 8.7.8. It also occures in drupal 8.7.6.

steps to reproduce:

  • create a "view" with a page set it on a content with taxonomy field
  • set the path to "/the-register/%"
  • create a "Relationship" "Taxonomy term" with "Vocabularies" on the Taxonomy name and enable "Require this relationship"
  • create a "Contextual filter" on "Taxonomy term: Term ID", set "Relationship" on the previous created relation and "Provide default value" on "Fixed" and in the "Fixed value" "1" (the taxonomy term id)
  • save the view
  • press "Update preview"

Now you see some results in the preview, but if you go to "/the-register/asdfsdfs" nothing is shown

  • Did you go to /the-register/1 ? – No Sssweat Nov 7 at 8:09
  • what is the page URL that you said it's not working? – Yusef Nov 7 at 8:53
  • The real problem is, that i have two views one "/the-register", with a overview of taxonomy terms, and the second "/the-register/%" that shows all the content of that taxonomy term. So the link would be something as "/the-register/countach-gallardo-lp550-2-valentino-balboni". But when i test this with a contextual filter "Term ID" with " Provide default value" and "Fixed" with a value of "1" the preview works but not the page it self? – Jan-Derek Vos Nov 7 at 9:17
  • If you set your contextual filter to grab the % part and use that as an ID. Well because countach-gallardo-lp550-2-valentino-balboni is not a term id... term id's need to be numeric. Needs to be /the-register/1 – No Sssweat Nov 7 at 10:07
  • Thanks for your answer! I explane it in more detail. – Jan-Derek Vos Nov 8 at 7:47

Your Answer

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

Browse other questions tagged or ask your own question.