Closed (fixed)
Project:
Customerror
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Dec 2006 at 13:18 UTC
Updated:
5 Apr 2014 at 08:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kbahey commentedThis module does have that ability already.
Just create two functions in the template.php file in your theme directory, and put in it:
function phptemplate_customerror_403($content) {
// Do anything you want here
return $content;
}
function phptemplate_customerror_404($content) {
// Do anything you want here
return $content;
}
Comment #2
geodaniel commentedKhalid, thanks for the quick response! That's a great start, but I'd also love to be able to specify PHP code within the settings itself, like the way that the front_page module does it.
I've attached a patch that adds a variable for each error message to the settings page to enable PHP for that error message or not. If it's enabled then it will be run through drupal_eval() before display. I've tested this also if the message is overridden by a phptemplate_customerror_40x function and it appears to work fine in that situation too.
(The reason I'd like to have this ability too, is that we are using one theme (and subthemes) across a set of sites, and as far as I'm aware we can't override functions in a clean way to let us do different things on different sites. This would let us customise on a per-site basis.)
Comment #3
kbahey commentedCommitted to 4.7 and HEAD.
Thanks
Comment #4
geodaniel commentedThanks for committing these changes Khalid
Comment #5
geodaniel commentedI've just noticed the changes were only on the MAIN branch - please could you also tag those latest versions as DRUPAL-4-7?
Comment #6
kbahey commentedHmmm. Strange.
When I do cvs log, it says 4.7 is version 1.10, but the change is in 1.11.
Anyway, I deleted the tag and retagged it, but the new release is not showing up.
I created a support request for this here http://drupal.org/node/107727
Comment #7
(not verified) commented