Search code examples
typo3tx-newstypo3-9.x

How set up speaking links for news in TYPO3 9


Is it possible to setup speaking urls in TYPO3 9 for EXT:tt_news as it was with RealUrl in prev versions?


Solution

  • You need a route enhancer in your site configuration. There should be a config.yaml in your project after you created it in TYPO3 backend (Under "Site Configuration" -> "Sites").

    After that, you can find a working example in the documentation (for news) here: Route Enhacer Documentation

    A working route enhancer I have currently implemented for example looks like this:

    NewsPlugin:
      type: Extbase
      extension: News
      plugin: Pi1
      routes:
        - { routePath: '/blog/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }
      aspects:
        news_title:
          type: PersistedAliasMapper
          tableName: 'tx_news_domain_model_news'
          routeFieldName: 'path_segment'
          routeValuePrefix: '/'
    

    Bear in mind, that this configuration is stripped of some of the examples in documentation and doesn't support pagination.