Forums / Setup & design / Wrong ContentType : html served instead of xml

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" ;)