It would be great if Taxonomy Redirect will have select list for node types selecting wich terms links I want to rewrite.

Comments

jimijamesi’s picture

$nodetype = $node->type;
$nrarticle = 'resources/!tid/' . $nodetype;
return $nrarticle;

I 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??

jimijamesi’s picture

After 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)

$nodenum = node_load($nid);
$nodetype = $nodenum->type;
$nrarticle = 'resources/!tid/' . $nodetype;
return $nrarticle;

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

$nodetype = arg(0);
$nrarticle = 'resources/!tid/' . $nodetype;
return $nrarticle;