Forums / Install & configuration / 'Module not found' override

'Module not found' override

Author Message

Marc Boon

Monday 13 March 2006 1:54:33 am

Which template should I override for a custom page to display instead of the 'Module not found' page?

Heiner Wurbs

Monday 13 March 2006 2:09:11 am

Hi,
you can set this in the site.ini:

[SiteSettings]
DefaultPage=/content/view/full/2/
ErrorHandler=defaultpage

Set here the ErrorHandler to the defaultpage, then the module not found will not displayed
Heiner

Christian Johansen

Monday 13 March 2006 2:22:25 am

Isn't the default page also the page that users are redirected to when they log in? Isn't it possible to create a default error-page that is only used in case of errors?

Marc Boon

Monday 13 March 2006 3:21:35 am

Exactly!
'Module not found' generates a '404 Not Found' header, which is correct. So it should not show the default page, but a custom error page.
Normally, you would just create an override, but what are the override match conditions for the 'Module not found' template?

Marc Boon

Wednesday 15 March 2006 1:33:45 am

ErrorHandler=defaultpage does redirect to the defaultpage on an error, but with a 200 OK response.
How do I generate a custom error page with a 404 Not Found response?

Bruce Morrison

Wednesday 15 March 2006 1:58:18 am

Hi Marc

Have a look at error.ini I suspect you will be able to tweak some settings there to suit your needs.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Marc Boon

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!

John Kazakis

Thursday 03 April 2008 4:11:46 am

Marc,

I have used to your method successfully, however you mention "errors", have you been able to replace "access denied" errors with this same method? If so, how?

Thanks.

Stefan Eickhoff

Friday 25 April 2008 9:32:44 am

Hi,

it took me some time to figure out why this did not work on my eZ 4.0

there is an issue concerning this

http://issues.ez.no/IssueView.php?Id=12605&activeItem=1

it is fixed in the trunk version

http://pubsvn.ez.no/nextgen/trunk/lib/ezutils/classes/ezmodule.php

enjoy the day

Stefan

eZ debug

Timing: Jan 18 2025 10:38:58
Script start
Timing: Jan 18 2025 10:38:58
Module start 'content'
Timing: Jan 18 2025 10:38:58
Module end 'content'
Timing: Jan 18 2025 10:38:58
Script end

Main resources:

Total runtime0.1714 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.7344180.8281
Module start 'content' 0.00630.0075 768.5625102.0234
Module end 'content' 0.01380.1575 870.5859529.7422
Script end 0.1713  1,400.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00452.6274200.0002
Check MTime0.00150.8727200.0001
Mysql Total
Database connection0.00060.332110.0006
Mysqli_queries0.124472.57111410.0009
Looping result0.00140.81181390.0000
Template Total0.157091.610.1570
Template load0.00110.669310.0011
Template processing0.155890.923010.1558
Override
Cache load0.00080.462210.0008
Sytem overhead
Fetch class attribute can translate value0.00090.544910.0009
XML
Image XML parsing0.00030.152310.0003
General
dbfile0.00301.7661200.0002
String conversion0.00000.004230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs