0

Version:

TYPO3 10.4.18, News 8.5.2

Problem:

I need to generate multiple XML sitemaps, where all news originate from a single folder ID. They need to link to different news detail pages, based on different categories.

According to the documentation I need to use the extended sitemap GeorgRinger\News\Seo\NewsXmlSitemapDataProvider, it also states the following:

Single-view page for news from this category of a sys_category you need to use a custom provider.

It also states:

To enable the category detail page handling, checkout the setting useCategorySinglePid = 1 in the following full example:

plugin.tx_seo {
    config {
        xmlSitemap {
            sitemaps {
                news {
                    provider = GeorgRinger\News\Seo\NewsXmlSitemapDataProvider
                    config {
                        excludedTypes = 1,2
                        additionalWhere =
                        ## enable these two lines to generate a Google News sitemap
                        # template = EXT:news/Resources/Private/Templates/News/GoogleNews.xml
                        # googleNews = 1

                        sortField = datetime
                        lastModifiedField = tstamp
                        pid = 84
                        recursive = 2
                        url {
                            pageId = 116
                            useCategorySinglePid = 1

                            hrDate = 0
                            hrDate {
                                day = j
                                month = n
                                year = Y
                            }

                            fieldToParameterMap {
                                uid = tx_news_pi1[news]
                            }

                            additionalGetParameters {
                                tx_news_pi1.controller = News
                                tx_news_pi1.action = detail
                            }

                            useCacheHash = 1
                        }
                    }
                }
            }
        }
    }
}

In the code above I can see that in pid Newsitems are stored, pageId is where the detail page is. useCategorySinglePid enables the category detail page handling. So how and where do I define what specific category should be shown in the sitemap? Do I have to define this using additionalWhere? The way the documentation tries to explain what needs to be done is rather confusing. Any help is greatly appreciated.

Rob
  • 14,746
  • 28
  • 47
  • 65
Scopestyle
  • 643
  • 5
  • 18

1 Answers1

0

I had this same problem. I tried to find a solution but with no success.

At the end I have something like this:

additionalWhere = uid IN (SELECT uid_foreign FROM sys_category_record_mm WHERE uid_local=14)

Where uid_local is uid of category. Resolved with help from Kurt, thank you.

plugin.tx_seo.config {
xmlSitemap {
    sitemaps {
        innovationen {
            provider = GeorgRinger\News\Seo\NewsXmlSitemapDataProvider
            config {
                additionalWhere = uid IN (SELECT uid_foreign FROM sys_category_record_mm WHERE uid_local=11)
                sortField = sorting
                lastModifiedField = tstamp

                pid = 156

                recursive = 2
                url {
                    pageId = 157
                    useCategorySinglePid = 1

                    fieldToParameterMap {
                        uid = tx_news_pi1[news]
                    }
                    additionalGetParameters {
                        tx_news_pi1.controller = News
                        tx_news_pi1.action = detail
                    }
                    useCacheHash = 0
                }
            }
        }
        trends {
            provider = GeorgRinger\News\Seo\NewsXmlSitemapDataProvider
            config {
                additionalWhere = uid IN (SELECT uid_foreign FROM sys_category_record_mm WHERE uid_local=12)
                sortField = sorting
                lastModifiedField = tstamp

                pid = 156

                recursive = 2
                url {
                    pageId = 160
                    useCategorySinglePid = 1

                    fieldToParameterMap {
                        uid = tx_news_pi1[news]
                    }
                    additionalGetParameters {
                        tx_news_pi1.controller = News
                        tx_news_pi1.action = detail
                    }
                    useCacheHash = 0
                }
            }
        }
    }
}
Tyler2P
  • 2,324
  • 26
  • 22
  • 31