Wrong ContentType : html served instead of xml

Author Message

william blanc dit jolicoeur

Tuesday 29 April 2008 5:30:50 am

Hi,

I set up some rss feeds in my project. (using eZ Publish 3.8.7).
So I created a particular pagelayout in layout.ini.append.php:

[rss]
PageLayout=rss_pagelayout.tpl
ContentType=text/xml

This new pagelayout is well recognized as a "/layout/set/rss" URL serves me the right pagelayout.
Unfortunately, the page is served with content-type "text/html" instead of "text/xml" as described in the .ini file.

I cleared all caches and every the seems to be correctly set but I still got the problem.

Does anyone has any idea but that issue ?
Thanks

william blanc dit jolicoeur

Tuesday 29 April 2008 5:46:45 am

Answering myself as I just got the solution :

Actually I created an override on the pagelayout:

[rss_pagelayout]
Source=pagelayout.tpl
MatchFile=rss_pagelayout.tpl
Subdir=templates
Match[viewmode]=rss_full

So that when I call a page in rss_full viewmode (or an override of it), the right pagelayout were used.

I expected the 2 Urls "/layout/set/rss/content/view/rss_full/2" and "/content/view/rss_full/2" to give the same result.
But, in facts, the content type is different and only the "layout/set/rss" will respond as text/xml.

Is that a bug, or a feature ?
Well, I understand that it's not a bug as the overrided pagelayout.tpl is to be a "text/html" content.
By the way, there's no particular need overriding the normal pagelayout if I set my url translator with "layout/set/rss" ;)

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 18:40:48
Script start
Timing: Jan 18 2025 18:40:48
Module start 'layout'
Timing: Jan 18 2025 18:40:48
Module start 'content'
Timing: Jan 18 2025 18:40:49
Module end 'content'
Timing: Jan 18 2025 18:40:49
Script end

Main resources:

Total runtime0.8529 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.0469152.6406
Module start 'layout' 0.00840.0033 740.687539.4766
Module start 'content' 0.01170.8397 780.1641467.4922
Module end 'content' 0.85140.0015 1,247.65638.1250
Script end 0.8529  1,255.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4062160.0002
Check MTime0.00130.1502160.0001
Mysql Total
Database connection0.00300.357110.0030
Mysqli_queries0.794593.1479520.0153
Looping result0.00050.0617500.0000
Template Total0.818896.020.4094
Template load0.00200.238520.0010
Template processing0.816895.762620.4084
Template load and register function0.00020.017910.0002
states
state_id_array0.00100.118110.0010
state_identifier_array0.00180.206220.0009
Override
Cache load0.00170.1965240.0001
Sytem overhead
Fetch class attribute can translate value0.00070.077510.0007
Fetch class attribute name0.00110.131230.0004
XML
Image XML parsing0.00650.767510.0065
class_abstraction
Instantiating content class attribute0.00000.001540.0000
General
dbfile0.00680.7957160.0004
String conversion0.00000.001440.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/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: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs