testing
testing

Reputation: 20279

tt_news and RealURL: shorten URL of news article

Currently the URL for a news article looks like

www.domain.com/path/to/page/news/news-detail/article/articlename

Is there a way to shorten this URL? E.g. missing out article or news-detail?

In the RealUrl-Configuration there is the array article but I don't know if I can change this for example to news-detail ...

Do you have some ideas?

I'm using Typo3 4.5.5, realurl 1.11.2 and tt_news 3.0.1.

Upvotes: 1

Views: 3334

Answers (2)

konsolenfreddy
konsolenfreddy

Reputation: 9671

If you want to exclude the keywords indicating a new part of the rewritten url, use fixedPostVars:

'fixedPostVars' => array(
    '123' =>array(
        array(
            'GETvar' => 'tx_ttnews[tt_news]',
            'lookUpTable' => array(
                'table' => 'tt_news',
                'id_field' => 'uid',
                'alias_field' => 'title',
                'addWhereClause' => ' AND NOT deleted',
                'useUniqueCache' => 1,
                'useUniqueCache_conf' => array(
                    'strtolower' => 1,
                    'spaceCharacter' => '-',
                ),
            ),
        ),
    ),
),

This will create a url like domain.com/article/your-article-title, presuming you have the following site structure:

root
 |- news (pid xy)
 |- article (pid 123)

You can also have the list and detail view on the same page which would make even cleaner urls (domain.com/news/your-article-title):

root
 |- news (pid 123, configured for list and detail)

Upvotes: 3

Fedir RYKHTIK
Fedir RYKHTIK

Reputation: 9974

One way is to exclude some pages to be shown in the URL path ?

www.domain.com/news-detail/article/articlename

You could also use another key as identifier (for example, Id instead of the news title). It will be less human-readable, but much shorten.

www.domain.com/news-detail/article/articleid

Upvotes: 1

Related Questions