-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide better ways to extend RSS feeds #1243
Comments
I think we should move away from our implementation in general. I'm using |
Definitely need improvement here. |
@leofeyer what are you looking for help for? |
@zonky2 |
Closing this as #4682 provides more flexibility now. |
Current state
Currently if you want to extend the RSS feeds provided by the
news-bundle
orcalendar-bundle
with additional data, you would have to do the following steps (more or less), if you still want to provide Contao's functionality of creating the RSS feeds in the back end:generateXmlFiles
Hooks and thegenerateNewsFeeds
/generateCalendarFeeds
cronjobs with your own class and method.generateFeed
onload_callback
fortl_news_feed
andtl_calendar_feed
with your own class and method.Feed
andFeedItem
classes are limited.This is cumbersome and would not work if more than one extension wants to add more items to the feeds.
Use Cases
Facebook Instant Articles
When using an RSS feed for Facebook Instant Articles, your RSS feed items must contain a
<content:encoded>
element with the required markup of the detailed content of your news item. This requires the support of your RSS library to create such an element and the<rss>
header needs to be expanded withxmlns:content="http://purl.org/rss/1.0/modules/content/"
.Adding locations to events
You might want to add the location of your event to the RSS feed. There is an
event
namespace draft for RSS which includes a location item: http://web.resource.org/rss/1.0/modules/event/Possible implementation
The
Feed
class would need support for any namespace (or at least any existing namespace) and theFeedItem
class would need support to add any elements from such namespaces. The FeedWriter library for example supports these namespaces automatically. Before creating the<rss>
header, it processes each feed item and then adds the necessary namespace declarations automatically.Then the existing
generateFiles
methods could add simple hooks so that the$objFeed
and$objItem
objects can be altered.The text was updated successfully, but these errors were encountered: