[TYPO3-ttnews] realurl: simplifying the url

Claudio Strizzolo claudio.strizzolo at ts.nogarb.ageinfn.it
Fri Feb 6 10:34:58 CET 2009


Hi all
I'm trying to find a way to shorten the URLs generated by tt_news+realurl.
At present my single news are indexed as

http://www.example.com/news/single_news_view/archive/2009/01/article/
title.html

single_news_view is the name of my page containing the tt_news plugin to 
display a single news item.
I'd like to remove the "archive" and "article" levels, if possible:

http://www.example.com/news/single_news_view/2009/01/title.html

but this might be acceptable too:

http://www.example.com/news/2009/01/single_news_view/title.html

As an extra point: might the whole "archive/2009/01/article" be somehow 
replaced by the category containing the news item? In my case every news 
is assigned to only one category, so this might be a good result too:

http://www.example.com/news/single_news_view/category/title.html

Any hints?

My TS setup:

plugin.tt_news {
  dontUseBackPid = 1
  useHRDates = 1
  useHRDatesSingle = 1
  useHRDatesSingleWithoutDay = 1
}


My localconf.php:

$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
     '_DEFAULT' => array(
        'init' => array(
          'enableCHashCache' => 1,
          'appendMissingSlash' => 'ifNotFile',
          'enableUrlDecodeCache' => 1,
          'enableUrlEncodeCache' => 1,
        ),

        'redirects' => array (),

        'preVars' => array(
            '0' => array (
              'GETvar' => 'no_cache',
              'valueMap' => array (
                 'nc' => '1'
              ),
              'noMatch' => 'bypass'
            ),
            '1' => array(
              'GETvar' => 'L',
              'valueMap' => array(
                 'it' => '0',
                 'en' => '6',
              ),
              'noMatch' => 'bypass',
              'valueDefault' => 'it',
            ),

        ),

        'fileName' => array(
           'defaultToHTMLsuffixOnPrev' => 1,
        ),

        'pagePath' => array(
           'type' => 'user',
           'userFunc' => 'EXT:realurl/
class.tx_realurl_advanced.php:&tx_realurl_
advanced->main',
           'spaceCharacter' => '-',
           'languageGetVar' => 'L',
           'expireDays' => '10',
           'rootpage_id' => '34',
        ),

        'fixedPostVars' => array(),
 
        'postVarSets' => array(
          '_DEFAULT' => array(
              // news archive parameters
              'archive' => array(
                 array(
                   'GETvar' => 'tx_ttnews[year]' ,
                 ),
                 array(
                   'GETvar' => 'tx_ttnews[month]' ,
                   'valueMap' => array()
                 ),
             ),
              // news pagebrowser
              'browse' => array(
                 array(
                   'GETvar' => 'tx_ttnews[pointer]',
                 ),
              ),
              // news categories
              'select_category' => array (
                array(
                  'GETvar' => 'tx_ttnews[cat]',
                ),
              ),

              // news articles and searchwords
              'article' => 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' => '-',
                    ),
                  ),
                ),
                array(
                  'GETvar' => 'tx_ttnews[swords]',
                ),
              ),
          ),
        ),
    ),
 );


More information about the TYPO3-project-tt-news mailing list