How to display an external RSS feed in a template

Author Message

David Zaoui

Tuesday 08 July 2008 9:54:45 am

Hello,

I have a simple question : I must display a list of some news in a template. These news can be found in a RSS feed of an other website( address of the RSS feed is like "http://www.awebsite.com/afolder/feed"). I don't know how if there is a simple was to just extract the latest news included in this feed and just displaying it in my template. Do you know ho to do that ?

Thanks

David

Ivo Lukac

Tuesday 08 July 2008 11:15:07 am

Hello David,

Don't know how good you are with writing own extensions but you can make a template operator for this case using the code from cronjobs/rssimport.php.
For this case you would not create objects in db just return the data array which you can iterate in template.

Greetz

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivo Lukac

Tuesday 08 July 2008 11:17:03 am

Looks like there is something already in contributions:
http://ez.no/developer/contribs/template_plugins/ezrssfeed

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

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

Main resources:

Total runtime0.9188 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.1797152.6406
Module start 'layout' 0.00570.0032 741.820339.4922
Module start 'content' 0.00890.9084 781.3125534.0938
Module end 'content' 0.91730.0014 1,315.406312.1250
Script end 0.9188  1,327.5313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3720160.0002
Check MTime0.00130.1440160.0001
Mysql Total
Database connection0.00080.085310.0008
Mysqli_queries0.866794.3259570.0152
Looping result0.00050.0562550.0000
Template Total0.885796.420.4429
Template load0.00230.250520.0012
Template processing0.883496.144520.4417
Template load and register function0.00020.019310.0002
states
state_id_array0.00090.095710.0009
state_identifier_array0.00150.164020.0008
Override
Cache load0.00190.2064170.0001
Sytem overhead
Fetch class attribute can translate value0.00060.069120.0003
Fetch class attribute name0.00160.177640.0004
XML
Image XML parsing0.00070.076620.0004
class_abstraction
Instantiating content class attribute0.00000.001650.0000
General
dbfile0.00080.0857170.0000
String conversion0.00000.001240.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs