I have a couple Variants set up for my node type with Selection Rules via Page Manager. If for some reason none of the rules are met for all the variants, it renders the node using the default node system instead of sending to a 404. How can I send the user to a 403 page instead?

1 Answer 1


I took care of this using hook_node_view(). This will only run if it is using the node system.

 * Implements hook_node_view().
function mymodule_node_view($node, $view_mode, $langcode) {
  if ($node->type == 'collection' && $view_mode == 'full') {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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