Wednesday 15 March 2006 3:37:12 am
Thanks for the tip! I created a error.ini.append.php in my siteaccess/override folder (actually, in my extension/site/settings/override folder, since I use a extension for the common settings of my multilingual site). It looks like this:
[ErrorSettings-kernel]
# 404 handler for 'module not found'
ErrorHandler[20]=rerun
RerunURL[20]=/content/view/full/380
The rerun handler assures that the correct HTTP response '404 - Not Found' is send. In my override.ini.append.php, I have specified a override template for error pages, which are Folder objects, contained in a Folder with node id 379:
# content/view/full template for error pages
[error_page]
Source=node/view/full.tpl
MatchFile=error_page.tpl
Subdir=templates
Match[parent_node]=379
I create a Folder object for each error, with the error code as short_name, the error message as name, and a optional short and long description. The 404 folder has node id 380.
In the template file error_page.tpl, I display the folder attributes in my site style, embedded in the sites pagelayout template. Since I run a multilingual site, all attributes are also translated, so each language's siteaccess gets the error messages in the correct language. Works like a charm!
|