It's not obvious why blocks are shown on 403 pages but not on 404 pages. It would be very useful (and save support requests!) if this was mentioned in the docs with a link to the 404 Blocks module.

Comments

el_reverend’s picture

Issue tags: +error, +block, +blocks, +404, +custom, +403

Second that. How can I get my blocks to reappear on a 404?

el_reverend’s picture

Nothing since? Did anyone figure out a way to display block on a 'page' that does not exist? Could you use contexts?

el_reverend’s picture

I have found a solution with the 404block module. It works great with CustomError but needs some configuration if you are using the Context module to display your blocks, etc.

In my case I am using context to display various blocks for various regions, so I have no regular blocks assigned to regions, but this will also display any blocks when a 404 is invoked. Since contexts (at this time) cannot match a php expression I decided to set my block in admin/build/block and only show them when a php function return true.
Here is the code from the 404block module slightly modified:

<?php
 if (strpos(drupal_get_headers(), '404 Not Found') !== FALSE) {
    // Show all regions.
    return TRUE;
  }
?>

Now I have my '404' blocks configure the drupal way and all other shown via the context module. Hope this helps others

gisle’s picture

As far as I am able to tell, this is not an issue for the Drupal 7 version of this module (i.e. links in the navigation block appear on the custom 403 and 404 pages produced by this module).

However, it may still remain an issue for the Drupal 6 version (I have not tested this version). If so this should be mentioned in the README.txt, with a reference to the 404 Blocks module as a possible solution.

See also: http://drupal.org/node/267163.

gisle’s picture

Status: Active » Fixed

Note added to README.txt of 6.x-1.2: https://drupal.org/node/2056029.

Status: Fixed » Closed (fixed)
Issue tags: -error, -block, -blocks, -404, -custom, -403

Automatically closed -- issue fixed for 2 weeks with no activity.