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.

eZ debug

Timing: Jan 31 2025 03:32:40
Script start
Timing: Jan 31 2025 03:32:40
Module start 'layout'
Timing: Jan 31 2025 03:32:40
Module start 'content'
Timing: Jan 31 2025 03:32:41
Module end 'content'
Timing: Jan 31 2025 03:32:41
Script end

Main resources:

Total runtime1.0357 sec
Peak memory usage8,192.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.1328151.2109
Module start 'layout' 0.00480.0031 739.3438220.6875
Module start 'content' 0.00791.0269 960.03134,296.0703
Module end 'content' 1.03480.0008 5,256.10167.8516
Script end 1.0357  5,263.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2993160.0002
Check MTime0.00120.1145160.0001
Mysql Total
Database connection0.00080.073210.0008
Mysqli_queries0.962792.9463540.0178
Looping result0.00050.0513520.0000
Template Total0.983795.020.4918
Template load0.00190.181820.0009
Template processing0.981894.792720.4909
Template load and register function0.00150.147110.0015
states
state_id_array0.00220.209010.0022
state_identifier_array0.00210.205720.0011
Override
Cache load0.00150.1462240.0001
Sytem overhead
Fetch class attribute can translate value0.00130.123820.0006
Fetch class attribute name0.00190.181120.0009
XML
Image XML parsing0.00020.021120.0001
class_abstraction
Instantiating content class attribute0.00000.000820.0000
General
dbfile0.00200.1913100.0002
String conversion0.00000.000640.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs