https://github.com/ntd/silverstripe-feedreader
A new page type that can access an external feed
https://github.com/ntd/silverstripe-feedreader
atom composer feed-reader module rss silverstripe silverstripe-4 silverstripe-module
Last synced: about 1 year ago
JSON representation
A new page type that can access an external feed
- Host: GitHub
- URL: https://github.com/ntd/silverstripe-feedreader
- Owner: ntd
- License: bsd-2-clause
- Created: 2014-01-06T13:52:44.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-09-07T13:47:42.000Z (over 2 years ago)
- Last Synced: 2025-03-22T09:02:16.662Z (about 1 year ago)
- Topics: atom, composer, feed-reader, module, rss, silverstripe, silverstripe-4, silverstripe-module
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: COPYING
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
silverstripe-feedreader
=======================
[](https://packagist.org/packages/entidi/feedreader)
[](https://travis-ci.org/ntd/silverstripe-feedreader)
[](https://scrutinizer-ci.com/g/ntd/silverstripe-feedreader/?branch=master)
[](https://packagist.org/packages/entidi/feedreader)
The [silverstripe-feedreader](http://silverstripe.entidi.com/) module
implements a new page type (*FeedReaderPage*) that can access the data
contained in an external RSS 2.0 or ATOM 1.0 feed. The feed format is
automatically deduced from its content, that is if the `//channel/item`
[XPath](http://www.w3.org/TR/xpath/) expression resolves to a non-emtpy
list it is considered an RSS2 feed, otherwise it is considered ATOM1,
and the `//feed/entry` expression will be used instead.
The main developement is done in `dev`: that is merged into `master` when
stable enough. When this happens, an appropriate `2.*` release is tagged.
`dev` and `master` branches, together with any `2.*` release, are compatibles
with SilverStripe 4. For SilverStripe 3 you should take a look at the `ss3`
branch and `1.*` releases.
Installation
------------
With composer:
composer require entidi/feedreader
Without composer, download [the tarball](https://github.com/ntd/silverstripe-feedreader/releases)
and unpack it under the base directory. This method is not really tested,
so it can be possible you will need to tweak something.
Usage
-----
The default template (`templates/eNTiDi/FeedReader/Layout/FeedReaderPage.ss`)
is compatible with [silverstrap](http://dev.entidi.com/p/silverstrap/) ^4.0
but it can be easily overriden by redefining the `FeedReaderPage.ss` file in
your own theme with higher priority.
To provide access to the latest news, you can define a function similar
to the following:
public function LatestNews()
{
$news = DataObject::get_one('eNTiDi\FeedReader\FeedReaderPage');
return $news ? $news->Items(1)->first() : null;
}
Then you can enhance your feed page with a template snippet, e.g.:
<% with $LatestNews %>
Latest news
$Date.Date: $Summary.XML
More ...
<% end_with %>
Support
-------
This project has been developed by [ntd](mailto:ntd@entidi.it). Its
[home page](http://silverstripe.entidi.com/) is shared by other
[SilverStripe](http://www.silverstripe.org/) modules and themes.
To check out the code, report issues or propose enhancements, go to the
[dedicated tracker](http://dev.entidi.com/p/silverstripe-feedreader).
Alternatively, you can do the same things by leveraging the official
[github repository](https://github.com/ntd/silverstripe-feedreader).