0

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?

0

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') {
    drupal_access_denied();
    drupal_exit();
  }
}
| improve this answer | |

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.