I use colorbox en colorbox-node to show the content of a node but I don't want people to access the node page for that content type.

How can I disable the node's detailpage and still access all the content in colorbox-node?


In node.tpl.php you can test if node is accessed directly, and if so - redirect him to page with the same node inside colorbox. Or any other page, of course.

  • By checking the arg variables or is there a hook or something to check if node is accessed directly? – Mr.B May 18 '13 at 12:24
  • There is no hook for that, as the only mode node.module knows about is direct one. Modules that provide other ways of access are supposed to provide needed hooks or variables. If colorbox doesn't, you can set variable in template for colorbox and then test for it in node's one, for example. – Mołot May 18 '13 at 13:21

Check for the "view mode" in your node template.

$view_mode: View mode; for example, "full", "teaser", "colorbox".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.