开发者

Drupal: Best place to put drupal_goto

开发者 https://www.devze.com 2023-01-06 14:00 出处:网络
I need to redirect certain content types to other nodes. As a proof of concept I\'ve got this working with a drupal_goto at the top of node--[type].tp开发者_StackOverflow社区l.php

I need to redirect certain content types to other nodes.

As a proof of concept I've got this working with a drupal_goto at the top of node--[type].tp开发者_StackOverflow社区l.php

This works great, but is probably the least optimized place to put it.

Would phptemplate_preprocess_node be too early? What about hook_nodeapi, $op='view'?

Where's the smartest place to put a drupal_goto?


hook_nodeapi's view hook is where I'd put it, yeah. It's going to be one of the first spots you'll have the $node variable to inspect for the node types you're redirecting.

0

精彩评论

暂无评论...
验证码 换一张
取 消