Zum Inhalt springen

Fehler in realurl-Konfiguration für tx_news und pagination?

Erstellt am 11. August 2016 · 1 Antwort · letzte Antwort am 24. August 2016

Tags: RealURL, tx_news, TYPO3 7, Frage

sachaw ·

Hi,

bei meiner Installation von tx_news habe ich ein Problem mit der Pagination von RealURL, dem ich nicht auf die Spur komme.

Daten zur Installation:
Typo3 7.6.x
RealURL 2.x
tx_news 4.3

Es gibt eine Seite mit dem Listenmodul (Aktuelles - 7), die auch für eine nach Kategorien gefilterte Ansicht genutzt wird. Dazu eine separate Seite für die Detailansicht (Artiekl - 14).

Seite mit dem Listenmodul wird gebildet als xxx.de/aktuelles.html - also richtig.
Artikel dann z.B. xxx.de/aktuelles/artikel/ein-test.html.
Link auf eine Kategorie ist xxx.de/aktuelles/kategorie.html.
Gibt es mehr Artikel einer Kategorie als die eingestellte Grenze, ist die 2. Seite auf xxx.de/aktuelles/kategorie/seite/2.html.

Das alles funktioniert auch.
Was NICHT funktioniert, ist das Blättern ohne Kategorie. Der Link im Frontend sieht richtig aus, xxx.de/aktuelles/seite/2.html. Allerdings gibt es einen 404 Fehler mit "Reason: Segment "2" was not a keyword for a postVarSet as expected on page with id=7".

Nehme ich die NewsCategoryConfiguration raus, klappt der gleiche Link für die Pagination, aber natürlich werden die Links für Kategorien nicht mehr gebaut.

Hier noch meine aktuelle realurl_conf.php:

<?php

$TYPO3_CONF_VARS['FE']['addRootLineFields'].= ',tx_realurl_pathsegment';
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
        'pagePath' => array(
                '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' => array(
                'enableCHashCache' => TRUE,
                'enableCHashCache' => 1,
                'respectSimulateStaticURLs' => 0,
                'enableUrlDecodeCache' => 1,
                'enableUrlEncodeCache' => 1
        ),
        'preVars' => array(
                array(
                        'GETvar' => 'L',
                        'valueMap' => array(
                                'en' => '1',
                        ),
                        'noMatch' => 'bypass',
                ),
                array(
                        'GETvar' => 'no_cache',
                        'valueMap' => array(
                                'nc' => 1,
                        ),
                        'noMatch' => 'bypass',
                ),
        ),
        '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'
                        ),
                        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,
                                )
                        )
                ),
                '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' => '-'
                                        )
                                )
                        )
                ),
                '14' => 'newsDetailConfiguration',
                '7' => 'newsCategoryConfiguration',

        ),
        'fileName' => array (
                'defaultToHTMLsuffixOnPrev' => true,
        ),
        'postVarSets' => array(
                '_DEFAULT' => array(
                        'controller' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[action]',
                                        'noMatch' => 'bypass'
                                ),
                                array(
                                        'GETvar' => 'tx_news_pi1[controller]',
                                        'noMatch' => 'bypass'
                                )
                        ),
                        'dateFilter' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
                                ),
                                array(
                                        'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
                                ),
                        ),
                        'seite' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
                                ),
                        ),
                ),
        ),

);

?>
sachaw · · Beste Antwort

So, nach einem hilfreichen Hinweis von anderer Stelle noch die Lösung für mein Problem, auf das sie jemand anderem auch helfen möge:

Die Konfiguration der Kategorien muss aus den fixedPostVars raus und in die normalen postVars. Also den ganzen "Block" newsCategoryConfiguration verschoben (und umbenannt), getestet, funktioniert auf Anhieb. Damit taucht "kategorie" nun zwar im Pfad auf, aber das ist ok.