Search code examples
realurl

TYPO3, Realurl, News: I am not getting right


I have a pretty straightforward Realurl 2.0 + News configuration, still it does not work as it should.

I get something like

http://mydomain/list-news-page/single-news-page/news/single-news-title/News/?tx_news_pi1[action]=detail&cHash=5f96d3b6bebd41076d2f752ea4d068d4 

and I wish to get rid of the /News/?tx_news_pi1[action]=detail&cHash=5f96d3b6bebd41076d2f752ea4d068d4 section. My typo3conf/realurl.autoconf.php sets:

'postVarSets' => 
     array (
       '_DEFAULT' => 
               array (
                'news' => 
                    array ( 
                          array(  'GETvar' => 'tx_news_pi1[action]',  ),
                          array(  'GETvar' => 'tx_news_pi1[controller]',
            ),
                 0 => 
                 array (  
    'GETvar' => 'tx_news_pi1[news]',
    'lookUpTable' => 
    array (
      'table' => 'tx_news_domain_model_news',
      'id_field' => 'uid',
      'alias_field' => 'title',
      'useUniqueCache' => 1,
      'useUniqueCache_conf' => 
      array (
        'strtolower' => 1,
        'spaceCharacter' => '-',

 ), ), ), ), ), )

I also have

 [globalVar = GP:L =0]
 ....
 config.defaultGetVars {
    tx_news_pi1 {
            controller=Notizie
            action=Dettaglio
    }
 }
[global]

but it does not seem to work.

Lastly, if I unset Enable automatic configuration [basic.enableAutoConf], pages not rendered.

TYPO3 6.2.23.


Solution

  • There are several errors in your code.

    1st: Don't translate the actions itself, so the config should be

    config.defaultGetVars {
            tx_news_pi1 {
                    controller=News
                    action=detail
            }
    }
    

    2nd: Take a look at the manual.

    You need to map the news uid to the title by using

    array(
        'GETvar' => 'tx_news_pi1[news]',
        'lookUpTable' => array(
            'table' => 'tx_news_domain_model_news',
            'id_field' => 'uid',
            'alias_field' => 'title',
            'addWhereClause' => ' AND NOT deleted',
            'useUniqueCache' => 1,
            'useUniqueCache_conf' => array(
                    'strtolower' => 1,
                    'spaceCharacter' => '-'
            ),
            'languageGetVar' => 'L',
            'languageExceptionUids' => '',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l10n_parent',
            'autoUpdate' => 1,
            'expireDays' => 180,
        )
    )