Search code examples
typo3typo3-7.6.xrealurltx-newsviewhelper

tx-news: use a main category in the link / speaking url


I am developing a site which has two main area's which I destinguish as two main system categories.

I use the latest version of tx-news (5.3.2) for articles and I assign them firstly to one of the two main system categories, and then to a specif category which exists for both main categories ...

in the frontpage I list a limited number of the latest articles, not limited by any category

  1. how can I create links that considers the choice of the main category?
  2. how can this show up in the Url: mydomain.com/category-1/article or mydomain.com/category-2/article

Solution

  • You need to copy the LinkViewViewHelper of EXT:news to a custom extension and add the category uid then to the link. After that it is possible to rewrite the id with realurl to the title.