Ad

Generate SEO Sitemap For Tt_address In TYPO3 And How To Beautify With Slugs

- 1 answer

I was searching all night on how to generate sitemap for tt_address records and coudn't find anything…… anyone knows how to generate it?

I also use route enhancers, is there a way to beautify my sitemap by using the slugs instead of the those long controllers, IDs, etc URLs?

Ad

Answer

so after reading and tweaking I came up with a working solution:

tx_seo.config.xmlSitemap.sitemaps {
  addresses {
    provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider
    config {
      table = tt_address
      sortField = sorting
      lastModifiedField = tstamp
      ### ID of address storage records ###
      pid = 13
      recursive = 2
      url {
        ### ID of detail view page ###
        pageId = 18
        fieldToParameterMap {
          uid = tx_ttaddress_listview[address]
        }
        additionalGetParameters {
          tx_ttaddress_listview.controller = Address
          tx_ttaddress_listview.action = show
        }
        useCacheHash = 1
      }
    }
  }
}

and the routeenhancer is:

routeEnhancers:
  AddressPlugin:
    type: Extbase
    extension: TtAddress
    plugin: ListView
    routes:
      -
        routePath: /
        _controller: 'Address::list'
      -
        routePath: '/{address_slug}'
        _controller: 'Address::show'
        _arguments:
          address_slug: address
    aspects:
      address_slug:
        type: PersistedAliasMapper
        tableName: tt_address
        routeFieldName: slug
Ad
source: stackoverflow.com
Ad