How do I redirect to eZ's standard 404 page from a template operator?

Author Message

Daniel Staver

Friday 10 September 2010 6:46:27 am

I want to make a template operator that generates a 404 response for a template and displays eZ's standard 404 page. How can I do this? I've figured out how to create the 404 header, but I don't know how to show the standard 404 page. Usually we override this to a custom template that fetches and article giving some helpful information to the user.

I want to use this operator to prevent google from indexing helper child nodes that are displayed as part of another template but have no full view themselves. Somehow google is picking up these nodes, even when there are no direct links to them.

Daniel Staver
http://daniel.staver.no

Jérôme Vieilledent

Friday 10 September 2010 7:27:03 am

Hi Daniel

What about embedding the error template :

{include uri="design:error/kernel/2.tpl"}

Gabriel Finkelstein

Friday 10 September 2010 12:11:36 pm

I think you don't need to show the 404 page. As long as you return a 404 error, Google won't index that page.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 04:58:25
Script start
Timing: Jan 18 2025 04:58:25
Module start 'layout'
Timing: Jan 18 2025 04:58:25
Module start 'content'
Timing: Jan 18 2025 04:58:26
Module end 'content'
Timing: Jan 18 2025 04:58:26
Script end

Main resources:

Total runtime0.9902 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.2031152.6563
Module start 'layout' 0.00540.0025 740.859439.4922
Module start 'content' 0.00790.9809 780.3516583.1797
Module end 'content' 0.98880.0014 1,363.531312.0938
Script end 0.9901  1,375.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3328160.0002
Check MTime0.00140.1444160.0001
Mysql Total
Database connection0.00060.061310.0006
Mysqli_queries0.940094.9290590.0159
Looping result0.00060.0610570.0000
Template Total0.956696.620.4783
Template load0.00210.210320.0010
Template processing0.954596.400620.4773
Template load and register function0.00010.009510.0001
states
state_id_array0.00130.132910.0013
state_identifier_array0.00100.099720.0005
Override
Cache load0.00170.1705140.0001
Sytem overhead
Fetch class attribute can translate value0.00060.056030.0002
Fetch class attribute name0.00100.103060.0002
XML
Image XML parsing0.00270.274230.0009
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00320.3253290.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs