1

I have built a blog listing page that uses a blog_listing view (set as a block, not page) in it (Drupal 10.1). Here is the setup for the view:

enter image description here

As you can see, I have three exposed filters. Blog category, blog date and a keyword search. On my frontend, when I filter by category, the url shows domain.com/blog?category=termId rather than domain.com/blog?category=termName. It also has all three query params even though I only filter for one (see screenshot below - filtered for taxonomy term "data" with ID of 96, but has the other two params too)

enter image description here

I have tried using contextual filters for this but I haven't been getting anywhere?? Also, I am using the better exposed filters module as you can see in the first screenshot above.

So, here are my questions:

  1. How can I display term name ?category=data instead of id ?category=96 in the url after filtering
  2. How do I get rid of other search params in the url if they are not part of the filter? like if I only select the filter option for a category, I don't want to see &field_publish=All&keys= as you see in the second screenshot.

Thanks for any help in advance.

1
  • Node content only stored term IDs in fields. To get the the term name you have to add the Relationship to Views for that field, then use Term name as the exposed filter. You can find examples in a lot of my answers about term name relationships. I haven't tried the filters paths, do you have each filter set to Optional? You might need to do path overrides on your Views queries to control them. The search parameters are parts of the filter.
    – prkos
    Dec 31, 2023 at 21:05

0

Your Answer

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

Browse other questions tagged or ask your own question.