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.
It would be great if Taxonomy Redirect will have select list for node types selecting wich terms links I want to rewrite.
Comments
Comment #1
jimijamesi CreditAttribution: jimijamesi commentedI have been trying to do this using $node->type
I also tried with $variables['type']
neither of these approaches work, the $nodetype variable is empty
Do I have to specifically load the $node object for a given node using the $nid
I am trying to redirect to a different url based on the node type.
Any suggestions??
Comment #2
jimijamesi CreditAttribution: jimijamesi commentedAfter many varied attempts I am still unable to target a taxonomy_redirect to a particular node type.
I tried this which I thought would work but did not (it works in a tpl but not in taxonomy_redir)
Eventually I had to take a different route and installed pathauto to auto add clean urls to nodes/content types
so it ends up as sitename.com/news_article/title_xyz
then I am able to use this code which works perfectly