Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by Daniel for How to implement a TYPO3 9.5 RSS Feed for Pages

plugin.tx_seo {    view {        templateRootPaths {            20 = EXT:ds_site/Resources/Private/Templates/Sitemaps/        }    }    config {        xmlSitemap {            sitemaps {                rssFeedAllBlogPosts {                    provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider                    config {                        table = pages                        sortField = tstamp                        lastModifiedField = tstamp                        additionalWhere = AND (no_index = 0 OR no_follow = 0)                        pid = 2                        recursive = 3                        template = RssFeed                    }                }            }        }    }}

version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Daniel Siepmann - Coding is Art</title><description>List of blog posts at daniel-siepmann.de</description><link>{f:uri.page(pageUid: 1, absolute: 1)}</link><atom:link href="{f:uri.page(pageUid: 1. pageType: 1533906435, additionalParams: {sitemap: 'rssFeedAllBlogPosts'}, absolute: 1)}" rel="self" type="application/rss+xml" /><lastBuildDate>{f:format.date(date: 'now', format: 'D, d M Y H:i:s O')}</lastBuildDate><ttl>1800</ttl><f:for each="{items}" as="item"><f:if condition="{item.data.doktype} < 200">                {f:render(section: 'Item', arguments: {                    item: item.data                })}</f:if></f:for></channel></rss><f:section name="Item"><item><title>{item.title}</title><description>{item.abstract}</description><link>{f:uri.page(pageUid: item.uid, absolute: 1)}</link><pubDate>{f:format.date(date: item.lastUpdated, format: 'D, d M Y H:i:s O')}</pubDate><guid isPermaLink="true">{f:uri.page(pageUid: item.uid, absolute: 1)}</guid></item></f:section>

You can use this one as a reference implementation. That's what I use for my website. Of course you need to adjust it accordingly, e.g. pid might be different, as well as extension key ds_site, etc.

Also note, this one uses EXT:seo, a system extension of TYPO3, providing sitemap features.

You can link to the feed: <a href="{f:uri.page(pageUid: 1, pageType: 1533906435, additionalParams: {sitemap: 'rssFeedAllBlogPosts'})}">RSS Feed</a>.

Also you might wanna adjust url routing:

routeEnhancers:  PageTypeSuffix:    type: PageType    default: .html    map:      .xml: 1533906435      .html: 0  Feed:    type: Simple    limitToPages:      - 1    routePath: '/feed/{sitemap_id}'    requirements:      sitemap_id: '[a-zA-Z].*'    _arguments:      sitemap: sitemap_id

Viewing latest article 1
Browse Latest Browse All 2

Trending Articles