Zum Inhalt springen

indexed_search mit realurl und Mehrsprachigkeit

Erstellt am 14. Februar 2018 · 1 Antwort · letzte Antwort am 16. Februar 2018

Tags: RealURL, Suche, TYPO3 7, Frage

limak_t3 ·

Ich habe mal eine Frage in die Runde.
Unser Kunde hat ein TYPO3 7.6 im Einsatz.
Indexed Search 7.6.23
RealURL 2.3.1

Meine Konfiguration RealURL.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' => '-',
                'rootpage_id' => 1,
                'firstHitPathCache'=>1,
                'languageGetVar' => 'L'
        ),
        'preVars' => array(
                array(
                        'GETvar' => 'L',
                        'valueMap' => array(
                                //'de' => '0',
                                'en' => '1',
                                'nl' => '2',
                                ),
                        //'valueDefault' => 'de',
                        //'noMatch' => 'bypass',
                )
        ),
        'fileName' => array(
            'defaultToHTMLsuffixOnPrev' => 1, // <-- Important part
            'acceptHTMLsuffix' => 1,
            'index' =>
            array(
                'print' =>
                array(
                    'keyValues' =>
                    array(
                        'type' => 98,
                    ),
                ),
            ),
        ),
        'init' => array(
                'enableCHashCache' => TRUE,
                'enableCHashCache' => 1,
                'respectSimulateStaticURLs' => 0,
                'enableUrlDecodeCache' => 1,
                'enableUrlEncodeCache' => 1
        ),
        'fixedPostVars' => array(
                
                'newsDetailConfiguration' => array(
                        array(
                                'GETvar' => 'tx_news_pi1[action]',
                                'valueMap' => array(
                                        'detail' => '1',
                                ),
                                'noMatch' => 'bypass'
                        ),
                        array(
                                'GETvar' => 'tx_news_pi1[controller]',
                                'valueMap' => array(
                                        'News' => '1',
                                ),
                                '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' => '-'
                                        ),
                                )
                        )
                ),
                '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' => '-'
                                        )
                                )
                        )
                ),
                '59' => 'newsDetailConfiguration',

        ),
        '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]',
                                ),
                        ),
                        'page' => array(
                                array(
                                        'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
                                ),
                        ),
                ),
        ),

);

?>

Mein TS

SEARCH = COA
			SEARCH {
				stdWrap.innerWrap.cObject = TEXT
				stdWrap.innerWrap.cObject {
					typolink {
						parameter = 26
						returnLast = url
					}
					wrap = <form action="#"><div class="form search-form standalone"><fieldset><div class="evt-placeholder-float evt-form evt-animated"><label for="tx-indexedsearch-searchbox-sword" class="">Suchen</label>|</div></fieldset></div></form>
					wrap.splitChar = #
				}
				10 = TEXT
				10.value = <input type="text" name="tx_indexedsearch[sword]" class="form-control input"/>
				20 = TEXT
				20.value = <button type="submit" class="tx-indexedsearch-search-submit" />Suche</button>
			}

Und Einstellungen Mehrsprachigkeit

config.linkVars = L(1-2)

# Deutsch
config.locale_all = de_DE.utf8
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 0
config.htmlTag_setParams = lang="de_DE" 

# Englisch
[globalVar = GP:L = 1] 
config.sys_language_uid = 1 
config.language = en 
config.htmlTag_langKey = en
config.locale_all = en_GB.utf8
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 1
config.htmlTag_setParams = lang="en_GB"
[global]

# Niederländisch
[globalVar = GP:L = 2] 
config.sys_language_uid = 2 
config.language = nl 
config.htmlTag_langKey = nl
config.locale_all = nl_NL.utf8
plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 2
config.htmlTag_setParams = lang="nl_NL"
[global]

Mein Problem:
Ich habe ein Suchfeld. Gebe ich ein Suchbegriff ein, dann wird folgende URL erzeugt:
https://domain.de/suche.html?tx_indexedsearch%5Bsword%5D=MeinSuchbegriff

Ich lande aber auf der Startseite, aber nicht auf der Suchergebnisseite.
Wenn ich die URL nun manipuliere:

https://domain.de/de/suche.html?tx_indexedsearch%5Bsword%5D=MeinSuchbegriff
Dann komme ich auch auf die Suchergebnisseite.

Kann mir einer erklären, warum indexed_search /de/ erwartet um die Suchergebnisseite aufrufen zu können?
Ich bin offenbar blind. 🙂

Danke euch.

pstranghoener ·

Hey limak_t3,
ich kann´s mir gerade auch nicht erklären. Hast du mittlerweile eine Antwort? Wäre cool, wenn du sie mit uns teilst.

Liebe Grüße
Philipp