Realurl-Конфигурация для новостей-Extensi

У меня проблема с конфигурацией новостей для realurl.
TYPO3: 7.6.11
realurl: 2.1.4
новости: 5.2.0

Я создал следующий файл realurl_conf.php. (http://pastebin.com/GsYVaaDr):

<?php
// realurl naming precedence configuration
$TYPO3_CONF_VARS['FE']['addRootLineFields'] .= 'tx_realurl_pathsegment,alias,title';

$TYPO3_CONF_VARS['EXTCONF']['realurl']['p372493.mittwaldserver.info'] = array(
    'init' => array(
        'enableCHashCache' => true,
        'appendMissingSlash' => 'ifNotFile',
        'adminJumpToBackend' => true,
        'enableUrlDecodeCache' => true,
        'enableUrlEncodeCache' => true,
        'emptyUrlReturnValue' => '/',
        // Allow for proper SEO 404 handling
        'postVarSet_failureMode' => ''
    ),

    'redirects'  => array(),
    'preVars' => array(
        array(
            'GETvar' => 'no_cache',
            'valueMap' => array(
                'nc' => 1
            ),
            'noMatch' => 'bypass'
        ),
        array(
            'GETvar' => 'L',
            'valueMap' => array(
                // Sprachvariable Deutsch
                'de' => '0',
            ),
        'noMatch' => 'bypass',
        ),
    ),
    // PAGEPATH mit Standard-Realurl-Konfiguration
    'pagePath' => array(
        'type'   => 'user',
        'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
        'spaceCharacter' => '-',
        'languageGetVar' => 'L',
        'rootpage_id'  => 1,
        'expireDays' => 30,
        // Nimmt Sysordner aus der Rootline (aktuell auskommentiert!)
        'excludeDoktypes' => '254',
        'segTitleFieldList' => 'tx_realurl_pathsegment,alias,title'
    ),
    'fixedPostVars' => array(
        'newsDetailConfiguration' => array(
            array(
                'GETvar' => 'tx_news_pi1[action]',
                'valueMap' => array(
                    'detail' => '',
                ),
                'noMatch' => 'bypass'
            ),
            array(
                'GETvar' => 'tx_news_pi1[controller]',
                'valueMap' => array(
                    'News' => '',
                ),
                'noMatch' => 'bypass'
            ),

            'dateFilter' => array(
                array(
                    'GETvar' => 'tx_newss_pi1[year]',
                ),
                array(
                    'GETvar' => 'tx_newss_pi1[month]',
                    'valueMap' => array (
                        'january' => '01',
                        'february' => '02',
                        'march' => '03',
                        'april' => '04',
                        'may' => '05',
                        'june' => '06',
                        'july' => '07',
                        'august' => '08',
                        'september' => '09',
                        'october' => '10',
                        'november' => '11',
                        'december' => '12',
                    ),
                ),
                array(
                    'GETvar' => 'tx_newss_pi1[day]',
                ),
            ),

            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,
                ),
            ),
        ), 
    ),
    'postVarSets' => array(
        '_DEFAULT' => array(

            // NEWS
           'newsCategoryConfiguration' => array(
               array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
                    'lookUpTable' => array(
                        'table' => 'sys_category',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-'
                        ),
                    ),
                ),
            ),
            'newsTagConfiguration' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                    'lookUpTable' => array(
                        'table' => 'tx_news_domain_model_tag',
                        'id_field' => 'uid',
                        'alias_field' => 'title',
                        'addWhereClause' => ' AND NOT deleted',
                        'useUniqueCache' => 1,
                        'useUniqueCache_conf' => array(
                            'strtolower' => 1,
                            'spaceCharacter' => '-'
                        ),
                    ),
                ),
            ),
            '28' => 'newsDetailConfiguration',
#           '701' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
#           '71' => 'newsTagConfiguration',
#           '72' => 'newsCategoryConfiguration',           

            'controller' => array(
                array(
                    'GETvar' => 'tx_news_pi1[action]',
                    'noMatch' => 'bypass'
                ),
                array(
                    'GETvar' => 'tx_news_pi1[controller]',
                    'noMatch' => 'bypass'
                ),
            ),

//          'archiv' => array(
//              'GETvar' => '',
//              noMatch => 'bypass'
//          ),
        // NEWS
        ),
    ),
    'fileName' => array (
        'defaultToHTMLsuffixOnPrev' => true,
        'index' => array(
            'sitemap.xml' => array(
                'keyValues' => array(
                    'type' => 841132,
                ),
            ),
            'feed.rss' => array(
                'keyValues' => array(
                    type => 9818,
                ),
            ),
            'calender.ical' => array (
                'keyValue' => array(
                    type => 9819,
                ),
            ),

            'robots.txt' => array(
                'keyValues' => array(
                    'type' => 841133
                ),
            ),

            'drucken.html' => array(
                'keyValues' => array(
                    'type' => '98',
                    'print' => '1'
                ),
            ),

            'index.html' => array(
                'keyValues' => array(
                    'type' => '0',
                ),
            ),
        ),
        'defaultToHTMLsuffixOnPrev' => true,
        'acceptHTMLsuffix' => true,
    ),

);
?>

Я настроил плагин новостей следующим образом.

plugin.tx_news {
  settings {
    backPid = 25
    listPid = 25

    detail {
      showPrevNext = 1
      showSocialShareButtons = 0
    }

    list {
      media {
        image >
        image {
          maxWidth = 75
          maxHeight = 75
        }
      }
    }

    link {
      skipControllerAndAction = 1
      hrDate = 1
      hrDate {
        day = d
        month = m
        year = Y
      }
    }    

    paginate {
      itemsPerPage = 10
      insertAbove = 1
      insertBelow = 1
      templatePath =
      prevNextHeaderTags = 1
      maximumNumberOfLinks = 3
    }

    analytics.social {
      facebookLike = 0
      facebookShare = 0
      twitter = 0
    }
  }
  predefine.archive = +1 Month
}

Эта проблема конфигурации решается в следующей форме:

/nachricht/detail/News/news-title/archiv/2016/september.html?tx_news_pi1%5Bday%5D=2&cHash=bc08b3c694b77edd4d3de72396906807

но мне нужен вывод адреса, подобный этой форме:

/nachricht/detail/News/2016/09/02/news-title.html

nachricht - это название страницы. Базовая конфигурация realurl работает нормально.

У кого-то есть идея или может сказать мне, как обновить мою новостную часть конфигурации?


person Michael Gnessner    schedule 08.10.2016    source источник


Ответы (1)


Во-первых, измените 'enableCHashCache' => true на 'enableCHashCache' => FALSE в вашем realurl_conf.php, чтобы удалить cHash = .... из вашего URL-адреса. и измените ниже код в массиве postVatSets для realurl. Попробуйте это решение и поделитесь своим мнением. Этот код у меня работает.

'postVarSets' => array(
        '_DEFAULT' => array(
            //archive
            'period' => array (
                array (
                    'condPrevValue' => -1,
                    'GETvar' => 'tx_ttnews[pS]',
                    //'valueMap => array()
                    ),
                array (
                    'GETvar' => 'tx_ttnews[pL]',
                    //'valueMap => array()
                    ),

                array (
                    'GETvar' => 'tx_ttnews[arc]',
                    'valueMap' => array(
                        'non-archived' => -1,
                        ),
                    ),
                ),
            'archive' => array(
                    array(
                        'GETvar' => 'tx_ttnews[year]' ,
                        ),
                    array(
                        'GETvar' => 'tx_ttnews[month]' ,
                            'valueMap' => array(
                            'january' => '01',
                            'february' => '02',
                            'march' => '03',
                            'april' => '04',
                            'may' => '05',
                            'june' => '06',
                            'july' => '07',
                            'august' => '08',
                            'september' => '09',
                            'october' => '10',
                            'november' => '11',
                            'december' => '12',
                            )
                        ),
                    ),

            'browse' => array (
                array (
                    'GETvar' => 'tx_ttnews[pointer]',
                    ),
                ),
            'select' => array (
                array (
                    'GETvar' => 'tx_ttnews[cat]',
                    'lookUpTable' => array (
                        'table'     =>  'tt_news_cat',
                        'id_field'  =>  'uid',
                        'alias_field'   =>  'title',
                        'addWhereClause'=>  'AND NOT deleted',
                        'useUniqueCache'=>  1,
                        'useUniqueCache_conf'   =>  array (
                            'strtolower'        =>  1,
                            'spaceCharacter'    =>  '-',
                            ),
                        ),
                    ),
                ),
            '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'    =>  '-',
                            ),
                        ),
                    ),
                ),
            ),
        ),  
person Vimal Usadadiya    schedule 10.10.2016
comment
Привет, Вимал, я был в отпуске, завтра вечером попробую твою конфигурацию и дам тебе ответ. Спасибо за отзыв и надеюсь, что он поможет мне в решении моей проблемы. - person Michael Gnessner; 19.10.2016
comment
хорошо, сначала попробуйте и дайте мне знать, работает ли решение. - person Vimal Usadadiya; 20.10.2016
comment
Спасибо, с помощью этого фрагмента я смог настроить указатель даты моего news-EXT. Это было полезно. - person Michael Gnessner; 22.10.2016