RSS and languages with FireFox

Author Message

Caroline Condamin

Thursday 26 March 2009 9:23:24 am

Hello everybody,

I have a problem formatting RSS feeds with Firefox. The browser displays me an XML tree.

I have 2 siteaccess 'fre' and 'eng'. 'fre' is my default site acces.
I have an export RSS of the videos of my site.

I first configure my RSS feed filling the field "Site URL" with: "http://www.mysite/index.php/"
=> when I click on the link of an object on the RSS page, the URL does not contain any siteaccess, so the redirected page is in french (default site acces) even if my RSS page was in english.
=> the style of my Rss pages was good on IE and Firefox

So I let the field "Site URL" empty
=> the problem of the missing site access in the Url of the object is solved: it is automatically retrieved from the current Url.
=> Firefox displays an XML tree without any style and there are no more easy way to subscribe to the RSS feed. (IE is OK)

I think overriding the template of the RSS feed could be a solution, but it seems to be a default browser template...

Does any body has an Idea??

Any help would be welcome!!
Thanks

Caroline

Jaime Smith

Tuesday 19 May 2009 11:00:38 am

Hey Caroline,

The problem with Firefox showing unstyled XML is because ez publishes RSS with the text/xml mime-type and Firefox needs it to be set to application/rss+xml. To make things worse IE doesn't understand the application/rss+xml mime type and will choke on that. I haven't found an easy way to get around this with overrides so I had to edit the kernel/rss/feed.php file to make the changes necessary to work for IE and others. Here's what I did.

Add the code below towards the bottom of the file just before the calls to the PHP header function. You'll need to remove the original call to the header('Content-Type.

Hope that helps.

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie') === false ) { 	 
	header( 'Content-Type: application/rss+xml; charset=' . $httpCharset );
} else {
	header( 'Content-Type: text/xml; charset=' . $httpCharset );
} 

Jaime Smith
Senior Developer
Certified ezPublish Developer
http://www.duoconsulting.com > Duo Consulting, Chicago, IL, USA

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