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.
Is possible to use only one vocabulary for a reference term used in multiple content types? And the term link point to a different view?
For example...
I have the vocabulary Cities and work with two content types, News and Events. I would like that when select a city in a node News, then go to a view with only the content type News.
Or I need to create one vocabulary per content type?
Comments
Comment #1
DuaelFrThis module does not allow to do what you want and, moreover, I think it would be really complicated because you cannot really know from which node your user is coming when he arrives on a taxonomy term (nor anywhere else).
If your need is to have a view showing only nodes of types A and another only nodes of types B you may use two different taxonomies and synchronize them with a bit of code (hook_taxonomy_term_insert).
I don't know exactly what you need but what you wrote here is really hard and even if you made something it would never really be reliable.
Comment #2
RAFA3L CreditAttribution: RAFA3L commentedYes, I understand...
But imagine you have more than one content type and all could use the same city vocabulary. I don't know if is possible redirect a term depending of the content type, of course, the term will be displayed inside of a node.
The problem is when the term is displayed outside of the content, for example in a menu or taxonomy view display, there is no reference from where the term come.
Comment #3
DuaelFrYou could try to use a view with an exposed filter on the content type, hidden with CSS or some php code.
Then in your nodes you would have to add something like
?type=mytype
to the terms' urls.This is the only way to reliably detect the origin of your user.
Comment #4
charlie charles CreditAttribution: charlie charles commentedMaybe try https://drupal.org/project/og_vocab
Comment #5
kevinquillen CreditAttribution: kevinquillen commentedComment #5.0
kevinquillen CreditAttribution: kevinquillen commentedexample