Return a 404 when a view pane in a page manager page has no result? When you have a view page that takes a contextual filter, you can easily set the no result behavior to a 404. But I am trying to do this when I have a view pane, in a page manager page like in the screenshot attached

If the view has no result (contextual fitter does not validate) I would like the page to return a 404.
You can implement hook_views_pre_render in your module to do this task

/**
 * Implements hook_views_pre_render().
 */
 function mymodule_views_pre_render(&amp;$view) {
   if ($view-&gt;name == 'myview' &amp;&amp; $view-&gt;current_display == 'mypane') {
     if (empty($view-&gt;result)) {
       drupal_not_found();
     }
  }
}