Wie parametriere ich die realurl_conf.php bzgl. tx_news im Hinblick auf die Detailseiten — angepasste URLs für die News Artikel im Detail —

Wie parametriere ich die realurl_conf.php bzgl. tx_news im Hinblick auf die Detailseiten — angepasste URLs für die News Artikel im Detail —

Siehe Abb. 1 rechts.

Bei der 47:
Nicht in sprechende URL aufnehmen => Aktiviert
Den gesamten Pfad überschreiben => Aktiviert
Pfadsegment für untergeordnete Seiten = '' (leer lassen)


Bei der 52:
Nicht in sprechende URL aufnehmen => Aktiviert
Den gesamten Pfad überschreiben => Aktiviert
Pfadsegment für untergeordnete Seiten = news


Bei der 53:
Nicht in sprechende URL aufnehmen => Aktiviert
Den gesamten Pfad überschreiben => Aktiviert
Pfadsegment für untergeordnete Seiten = termin

Und dann lautet die URL z.B.:
www.mydomain.de/news/das-ist-der-titel-der-news.html
oder
www.mydomain.de/termin/am-ende-des-jahres-ist-silvester.html

 

 

Es sollte noch erwähnt werden, dass folgendes News Setup Wichtig ist:
plugin.tx_news.settings.link.skipControllerAndAction = 1
damit in der Url keine doppelten // vorkommen!
Einen Dank für den Hinweis an Mike Zimmer aus dem TYPO3-Facebook-Forum! ;-)

Der Inhalt der realurl_conf.php

<?php
$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
/* ******************************************************************************
*  WICHTIG !!!!!!!!!!!!!!!!                                                     *
*  ab ca. Zeile 110 müssen die UIDs der Single-View-Pages eingetragen werden !  *
*********************************************************************************/

// Adjust to your needs
//$domain = 'www.domain.de';
$rootPageUid = 1;
//$rssFeedPageType = 9818; // pageType of your RSS feed page

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = [
        'pagePath' =>  [
                'type' => 'user',
                'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
                'spaceCharacter' => '-',
                'languageGetVar' => 'L',
                'expireDays' => '3',
                'rootpage_id' => 1,
                'firstHitPathCache'=>1
        ],
        'init' =>  [
                'enableCHashCache' => TRUE,
                'enableCHashCache' => 1,
                'respectSimulateStaticURLs' => 0,
                'enableUrlDecodeCache' => 1,
                'enableUrlEncodeCache' => 1
        ],
        'preVars' =>  [
                 [
                        'GETvar' => 'L',
                        'valueMap' =>  [
                                'en' => '1',
                        ],
                        'noMatch' => 'bypass',
                ],
                 [
                        'GETvar' => 'no_cache',
                        'valueMap' =>  [
                                '' => 1,
                        ],
                        'noMatch' => 'bypass',
                ],
        ],

        'fixedPostVars' => [
           'newsDetailConfiguration' => [
               [
                   'GETvar' => 'tx_news_pi1[action]',
                   'valueMap' => [
                       '' => 'detail',
                   ],
                   'noMatch' => 'bypass'
               ],
               [
                   'GETvar' => 'tx_news_pi1[controller]',
                   'valueMap' => [
                       '' => 'detail',
                   ],
                   'noMatch' => 'bypass'
               ],
               [
                   'GETvar' => 'tx_news_pi1[news]',

                   'lookUpTable' => [
                       'table' => 'tx_news_domain_model_news',
                       'id_field' => 'uid',
                       'alias_field' => 'IF(path_segment!="",path_segment,title)',
                       'addWhereClause' => ' AND NOT deleted',
                       'useUniqueCache' => 1,
                       'languageGetVar' => 'L',
                       'languageExceptionUids' => '',
                       'languageField' => 'sys_language_uid',
                       'transOrigPointerField' => 'l10n_parent',
                       'expireDays' => 180,
                       'enable404forInvalidAlias' => true
                   ]
               ]
           ],
           'newsCategoryConfiguration' => [
               [
                   'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
                   'lookUpTable' => [
                       'table' => 'sys_category',
                       'id_field' => 'uid',
                       'alias_field' => 'title',
                       'addWhereClause' => ' AND NOT deleted',
                       'useUniqueCache' => 1,
                       'enable404forInvalidAlias' => true
                   ]
               ]
           ],
           'newsTagConfiguration' => [
               [
                   'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                   'lookUpTable' => [
                       'table' => 'tx_news_domain_model_tag',
                       'id_field' => 'uid',
                       'alias_field' => 'title',
                       'addWhereClause' => ' AND NOT deleted',
                       'useUniqueCache' => 1,
                       'enable404forInvalidAlias' => true
                   ]
               ]
           ],

//        '70' => 'newsDetailConfiguration',
           '52' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
           '53' => 'newsDetailConfiguration',
           '47' => 'newsTagConfiguration',
           '47' => 'newsCategoryConfiguration',
        ],


       'postVarSets' => [
           '_DEFAULT' => [
               'controller' => [
                   [
                       'GETvar' => 'tx_news_pi1[action]',
                       'noMatch' => 'bypass'
                   ],
                   [
                       'GETvar' => 'tx_news_pi1[controller]',
                       'noMatch' => 'bypass'
                   ]
               ],

               'dateFilter' => [
                   [
                       'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                   ],
                   [
                       'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                   ],
               ],
               'page' => [
                   [
                       'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
                   ],
               ],
           ],
       ],

        // configure filenames for different pagetypes
        'fileName' => [
            // 1: mit .html; 0: ohne .html, nur "/"
            'defaultToHTMLsuffixOnPrev' => 1,
            'defaultToXMLsuffixOnPrev' => 1,
            'index' =>  [
                'print.html' => [
                    'keyValues' => [
                        'type' => 98,
                    ],
                ],
                'rss.xml' => [
                    'keyValues' => [
                        'type' => 100,
                    ],
                ],
                'rdf.xml' => [
                    'keyValues' => [
                        'type' => 102,
                    ],
                ],
                'atom.xml' => [
                    'keyValues' => [
                        'type' => 103,
                    ],
                ],
                'sitemap.xml' =>  [
                    'keyValues' =>  [
                        'type' => 200,
                    ],
                ],
            ],
        ],
];