It would be nice to have conditions for "not 403" and "not 404". I have some blocks that I want to display on every page *except* these error pages. I think I can work around it now by doing an error_page context and then doing a "not context" condition, but it would be cleaner to just be able to say "not on the error pages".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

George Bills’s picture

It also looks like "~error_page" (when error_page is the name of the context) doesn't work in a "context" condition. Other "~context" specifiers work fine.

George Bills’s picture

FileSize
1.2 KB

I wrote a patch to reverse the logic here. It's pretty hacky and it removes the ability to say "only show on 404 error pages", but it seems to work. Attached.

George Bills’s picture

FileSize
2.1 KB

Ignore the last - here's a much nicer patch.

It lets the user pick between "An error page", "403 error pages only", "404 error pages only" or "not an error page".

One problem is that the selection is done with checkboxes, but the logic only makes sense if one and only one value is picked. The selection should really be done using a select dropdown, but I didn't know how to do that inside the Context API.

Jānis Bebrītis’s picture

can we get this into release, please?

snufkin’s picture

Status: Active » Needs work

@PersonalPronoun Thanks very much for the patch! Could you take care that coding standards (http://drupal.org/coding-standards) are kept in the code and reroll the patch please?

szantog’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review
FileSize
3.55 KB

The refactored patch against today's update for d7.

snufkin’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed, thanks! Now if someone wants to backport it to D6 feel free, I am not going to work on that branch anymore.