Question

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?

Was it helpful?

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
),

OTHER TIPS

The best way to handle this is to create a small extension which extends the tt_news entries by a field which can be used as alternative for generating the title.

Realurl uses the field title by default to generate the article-url. The field that will be used can be modified in your realurl.conf.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top