{"id":21328424,"url":"https://github.com/wiredviews/xperience-rss-feeds","last_synced_at":"2025-03-16T00:17:10.186Z","repository":{"id":98317986,"uuid":"450934254","full_name":"wiredviews/xperience-rss-feeds","owner":"wiredviews","description":"RSS Feed Integration for ASP.NET Core based Kentico Xperience 13.0 applications using Content Tree Routing","archived":false,"fork":false,"pushed_at":"2022-03-21T00:16:09.000Z","size":322,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T12:49:00.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiredviews.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-22T20:59:42.000Z","updated_at":"2024-03-29T20:13:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebdf24c7-41c3-4292-87a5-7ad4f7a1b9b4","html_url":"https://github.com/wiredviews/xperience-rss-feeds","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fxperience-rss-feeds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fxperience-rss-feeds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fxperience-rss-feeds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiredviews%2Fxperience-rss-feeds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiredviews","download_url":"https://codeload.github.com/wiredviews/xperience-rss-feeds/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806114,"owners_count":20350783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T21:28:53.680Z","updated_at":"2025-03-16T00:17:10.167Z","avatar_url":"https://github.com/wiredviews.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xperience RSS Feeds\n\n[![NuGet Package](https://img.shields.io/nuget/v/XperienceCommunity.RSSFeeds.svg)](https://www.nuget.org/packages/XperienceCommunity.RSSFeeds)\n\nRSS Feed Integration for ASP.NET Core based Kentico Xperience 13.0 applications using Content Tree Routing\n\n## Dependencies\n\nThis package is compatible with ASP.NET Core 3.1+ and is designed to be used with ASP.NET Core applications integrated with Kentico Xperience 13.0.\n\n## How to Use?\n\n1. [Import the Page Type definition](https://docs.xperience.io/deploying-websites/exporting-and-importing-sites/importing-a-site-or-objects) included in this repository, for the version of the package your are installing, into your Administration application:\n\n   Example: [./src/XperienceCommunity.RSSFeeds.Import.v1.0.0.zip](./src/XperienceCommunity.RSSFeeds.Import.v1.0.0.zip)\n\n1. Install the NuGet package in your ASP.NET Core project\n\n   ```bash\n   dotnet add package XperienceCommunity.RSSFeeds\n   ```\n\n1. Register the package's types with the `IServiceCollection`\n\n   ```csharp\n   public class Startup\n   {\n       public void ConfigureServices(IServiceCollection services)\n       {\n           services.AddRSSFeeds();\n       }\n   }\n   ```\n\n1. Create a new Page (anywhere) in the Content Tree for your RSS Feed and populate the required fields:\n   \u003ca href=\"./images/01-new-rss-page-in-content-tree.jpg\"\u003e\n   \u003cimg src=\"./images/01-new-rss-page-in-content-tree.jpg\" alt=\"New RSS Page in Content Tree\" width=\"400\" /\u003e\n   \u003c/a\u003e\n\n1. Optional: Create your own custom `IRSSFeedItemsRetriever` implementation:\n\n   ```csharp\n   public class CustomRSSFeedItemsRetriever : IRSSFeedItemsRetriever\n   {\n       // ...\n\n       public async Task\u003cICollection\u003cItem\u003e\u003e RetrieveAsync(RSSFeedPage feedPage, CancellationToken token)\n       {\n           // ...\n       }\n   }\n   ```\n\n   Then register it with the `IServicesCollection`:\n\n   ```csharp\n   public class Startup\n   {\n       public void ConfigureServices(IServiceCollection services)\n       {\n           services.AddRSSFeeds\u003cCustomRSSFeedItemsRetriever\u003e();\n       }\n   }\n   ```\n\n## How Does It Work?\n\nKentico Xperience handles routing for the RSS feed using [Content Tree Routing](https://docs.xperience.io/developing-websites/implementing-routing/content-tree-based-routing).\n\nThis library provides a Controller and Page Type to connect the Content Tree Route to a dynamically generated RSS Feed.\n\nYou can create as many RSS Feed Pages as you need and select different Page Types for each of them if you want to host feeds for different content. The URL of the RSS Feed Page is the URL of the RSS Feed.\n\nIt also provides a default implementation of `IRSSFeedItemsRetriever` which uses the `DocumentPageTitle`, `DocumentPageDescription` and `DocumentPageKeywords` fields of retrieved pages to populate the RSS Feed.\n\nThe benefit of using these fields is that no SQL `UNION`s need performed to get all the necessary data if multiple Page Types are specified for the RSS Feed.\n\nBelow is an example of this metadata populated for a Page:\n\n\u003ca href=\"./images/02-article-in-content-tree-with-metadata.jpg\"\u003e\n    \u003cimg src=\"./images/02-article-in-content-tree-with-metadata.jpg\" alt=\"Article Page in Content Tree with Metadata\" width=\"400\" /\u003e\n\u003c/a\u003e\n\nAnd the resulting RSS Feed:\n\n\u003ca href=\"./images/03-example-rss-feed-content.jpg\"\u003e\n    \u003cimg src=\"./images/03-example-rss-feed-content.jpg\" alt=\"Generated RSS Feed\" width=\"400\" /\u003e\n\u003c/a\u003e\n\nIf the `RSSFeedController` is called from outside Xperience's routing or if the RSS Feed Page has no selected Page Types, the URL will return a 404.\n\n### Auto Populating `DocumentPageTitle`, `DocumentPageDescription` and `DocumentPageKeywords`\n\nPopulating the `TreeNode` fields used by this package can be additional work for Content Managers, especially when\nthe values they want in these fields already exist in the Page Type custom fields for each Page Type.\n\nFortunately this can be easily resolved by using Document Global Events in a custom Module class:\n\n```csharp\n[assembly: RegisterModule(typeof(TreeNodeEventsModule))]\n\nnamespace CMSApp\n{\n    public class TreeNodeEventsModule : Module\n    {\n        public TreeNodeEventsModule() : base(nameof(TreeNodeEventsModule)) { }\n\n        protected override void OnInit()\n        {\n            base.OnInit();\n\n            DocumentEvents.Insert.Before += Insert_Before;\n            DocumentEvents.Update.Before += Update_Before;\n        }\n\n        private void Update_Before(object sender, DocumentEventArgs e)\n        {\n            e.Node.SetValue(\"DocumentPageTitle\", ...);\n            e.Node.SetValue(\"DocumentPageDescription\", ...);\n            e.Node.SetValue(\"DocumentPageKeywords\", ...);\n        }\n\n        private void Insert_Before(object sender, DocumentEventArgs e)\n        {\n            e.Node.SetValue(\"DocumentPageTitle\", ...);\n            e.Node.SetValue(\"DocumentPageDescription\", ...);\n            e.Node.SetValue(\"DocumentPageKeywords\", ...);\n        }\n    }\n}\n```\n\n### Customizing Feed Item Creation\n\nIf you need to populate more of the fields for the RSS Feed Items (like Author), use something other than `DocumentLastPublished` to order the results populating the Feed, or populate the Feed items from specific database columns, then implement your own `IRSSFeedItemsRetriever` using whatever `DocumentQuery` fits your needs.\n\nYou can also use the `RSSFeedPage` parameter to populate different content for the same Page Types in different parts of the Content Tree.\n\n## Contributions\n\nIf you discover a problem, please [open an issue](https://github.com/wiredviews/xperience-rss-feeds/issues/new).\n\nIf you would like contribute to the code or documentation, please [open a pull request](https://github.com/wiredviews/xperience-rss-feeds/compare).\n\n## References\n\n- [RssSyndication project on GitHub](https://github.com/shawnwildermuth/RssSyndication)\n\n### Kentico Xperience\n\n- [Kentico Xperience Content Tree Routing docs](https://docs.xperience.io/developing-websites/implementing-routing/content-tree-based-routing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiredviews%2Fxperience-rss-feeds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiredviews%2Fxperience-rss-feeds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiredviews%2Fxperience-rss-feeds/lists"}