Skip to content
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

Closed
fritzmg opened this issue Dec 18, 2017 · 6 comments
Closed

provide better ways to extend RSS feeds #1243

fritzmg opened this issue Dec 18, 2017 · 6 comments

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Dec 18, 2017

Current state

Currently if you want to extend the RSS feeds provided by the news-bundle or calendar-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:

  1. Replace the generateXmlFiles Hooks and the generateNewsFeeds/generateCalendarFeeds cronjobs with your own class and method.
  2. Replace the generateFeed onload_callback for tl_news_feed and tl_calendar_feed with your own class and method.
  3. Use your own XML feed generation method, since Contao's Feed and FeedItem 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 with xmlns: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 the FeedItem 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.

@aschempp
Copy link
Member

I think we should move away from our implementation in general. I'm using debril/rss-atom-bundle in one of my projects which is a way better implementation, it also uses the reverse proxy cache instead of writing random files to the file system.

@asaage
Copy link

asaage commented Aug 14, 2018

Definitely need improvement here.
Being able to edit templates would help a lot.
I would also prefer to have just one format [atom|rss] that is a bit more flexible than two which aren't.

@fritzmg
Copy link
Contributor Author

fritzmg commented Feb 18, 2020

@leofeyer this issue was accidentally closed, since the wrong issue number was referenced in 877aaf7

@zonky2
Copy link
Contributor

zonky2 commented Dec 13, 2021

@leofeyer what are you looking for help for?

@fritzmg
Copy link
Contributor Author

fritzmg commented Dec 13, 2021

@zonky2 help wanted means we are seeking for people outside the core team to provide a possible PR.

@fritzmg
Copy link
Contributor Author

fritzmg commented Oct 17, 2022

Closing this as #4682 provides more flexibility now.

@fritzmg fritzmg closed this as completed Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants