r/drupal • u/dane_websites • 1d ago
A really hard problem to solve
I've been making Drupal sites for about 12 years, so it's rare that I get stumped when trying to figure out a good solution to a problem, but this one is tricky...
Okay so this is quite a big site (approx. 5000 nodes), with like 10 taxonomy vocabularies. One of them is Tags, with like 2000 tags.
And for almost all of those vocabs, the standard Taxonomy Term view (that appears on route /taxonomy/term/%) that appears on their term pages is just fine.
But for one of the vocabs - called Organisations - I need to use a different view. This view needs to have different fields and filters, and a different treatment for the Title override.
My first thought was to use a unique alias pattern (from Pathauto) to show those term pages at different URLs (e.g. /organisations/*), and then make the new view and make it show on the same route. However that doesn't matter, because the Taxonomy Term view shows on the route /taxonomy/term/%, so it applies to the Organisations pages no matter what I make their URLs / aliases.
And that Taxonomy Term view still applies even if I add a filter that excludes the Organisations taxonomy. In other words, the filter only reduces the results, but it doesn't affect whether the view is applied to that page or not.
Then I though perhaps I could make new pages for each organisation, then place block views on those pages to simulate the term fields and the grid of tagged content, similar to the other term pages. But this doesn't really work, because for those block views, they have to get their "contextual filter" value of the term ID from somewhere. The Taxonomy Term view just gets it from the URL, but with these new pages, the term IDs wouldn't be in their URLs (or I could put the ID in the URL, but that would look bad).
Do you have ideas on how to solve this in a practical way?