Search code examples
typo3tt-newsrealurl

Typo3 RealUrl + tt_news -> shorten URL


for my tt_news entries, realurl generates links like:

www.mydomain.com/announcements/news/news/article/date/2013/06/26/a_very_long_filename_which_is_horrible.html

so i try to get my typo3 to generate something like this:

www.mydomain.com/news/short_title.html

but I have no clue how to do this?


Solution

  • Although Merec's solution is some option, de facto you can do the trick without any single line of coding.

    1. Place the 'news' page dedicated for single view in the root tree (not in branch Announcements > News > News)
    2. Use tt_news' config to remove dates from URL -> check the manual, search for HRdates options, to avoid them.
    3. If required use fixedPostVars to make the URL's as short as possible on given (single) page.

    Also you have two options for horrible_long_title.html - first is using additional field in for tt_news where you can restrict the length in the BackEnd ie. to 100 chars...

    second probably better solution is allowing to use all characters by changing the RealURL config:

    'lookUpTable' => array(
        'table'               => 'tx_ttnews', // I don't remember now if it's correct tt_news' table...
        'maxLength'           => 9999, // By default it's 100
        'id_field'            => 'uid',
        'alias_field'         => 'title',
        // other config
    ),