Closed (fixed)
Project:
Customerror
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jul 2007 at 13:06 UTC
Updated:
17 Jun 2013 at 02:04 UTC
Is it possible to make CustomError use a custom page template, ala page-customerror.tpl.php?
Comments
Comment #1
physiotek commentedwould be very nice :)
was coming here in the issues section with he hope of finding such an info...
pht3k
Comment #2
kbahey commentedI have not tired, but it should work in principle.
In the template.php file of your theme, add the following function:
function phptemplate_customerror($error_code = 404, $content = NULL) {
return _phptemplate_callback('customerror', array('error_code' => $error_code, 'content' => $content));
}
Then create a customerror.tpl.php and put in it what you want.
Not sure if it will do what you want, but worth a try.
Comment #3
physiotek commentedhi,
well i was asking because i wanted back the columns drupal 5.1 removed from the error pages, and i just found here how to do this:
http://drupal.org/node/129762
but thanks for your reply; it is some info i was seeking for an other issue...
pht3k
Comment #4
mairav commentedWhat @kbahey mentioned in #2 in Drupal 6 would be:
Comment #5
krystianbuczak commentedHi,
I have just tried your function but doesn't work. What's wrong, any idea?
K.B.
Comment #6
mairav commentedIn
You have to change the word "afd", for the name of your theme, and then place in your theme folder the file customerror.tpl.php with the template in the way you want you custom error to appear.
Comment #7
kbahey commentedBetter than hard coding the theme path, you can do:
The code will be more portable this way.
Comment #8
mairav commented@kbahey Thanks! that did the job!
Comment #9
krystianbuczak commentedEven I create empty customerror.tpl.php file or leave only
print $contentline in the file all default page areas (header, content, footer) are still loaded.So, I guess that this code doesn't help me to change the way 404 page will be displayed. Am I right?
Thanks for all answers.
Comment #10
madwalo commentedi have almost the same problem but i have seen the same with other functions i try to use, phptemplate_ or themename_ functions never wors, i am using clean theme
many thanks
Comment #11
garethsprice commentedNo need to use CustomError to do this (although it'd be nice if it had support for it).
Set your error page to "404" under the "Error Reporting" textboxes.
In your template.php:
Source: http://drupal.org/node/603748
Comment #12
adr_p commentedOr, if you have CustomError enabled:
Comment #13
gisleLooks like this support request has received an answer.
Comment #15
alexkb commentedIn Drupal 7, you can override the template, simply by creating a "page--customerror.tpl.php" template. No preprocess calls are required in your template.php. If you want to have a different template for the 403 and 404 pages, simply create "page--customerror--403.tpl.php", "page--customerror--404.tpl.php".