Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would appreciate if anyone has any idea on how to achieve this task:
- Global filter is set on taxonomy term reference field, e.g. country list vocabulary
When global filter is set to one of the counties, I would like to have the url change to that particular country.
How can I do this ?
Thank you !
Comments
Comment #1
RdeBoerThat is a tough one.
Can only think of an ugly solution at the moment: using additional PHP code to redirect to the same base URL, appending a slash and the value selected (multiple slashes and values if there are multiple global filters active).
This is inefficient and may cause a flicker too.
Maybe it can be built into the module though as it sets the contextual filter...
Comment #2
sbydrupal CreditAttribution: sbydrupal commentedWould using redirect module a solution ? Possibly not... Global filter, as it sets, goes to the same url...
It would be great to make this happen as it will be great for site design for SEO, usability,...
Comment #3
sbydrupal CreditAttribution: sbydrupal commentedI see your point. I think you are referring to a redirect code within Global filter module that will append filter term as url tag...
In any case, will wait to see if such solution is possible in near term. Thx
Comment #4
RdeBoerRe #3:
Yes that what I meant. I just had a go at it and it's just too hard.
Once you have appended the contextual arguments to the URL the Global Filter will not work -- it is based on replacing the default contextual filter values, not on OVERRIDING the contextual arguments in the URL.
So, for now this is a no-can-do, I'm afraid...
Rik
Comment #5
sbydrupal CreditAttribution: sbydrupal commentedOK thx for your thoughts and time. no problem
Comment #6
RdeBoerSee #4. Too hard and too little time right now.
Please reopen, anyone, if you have a patch to share.
Rik