Index: typo3/sysext/indexed_search/ext_typoscript_setup.txt =================================================================== --- typo3/sysext/indexed_search/ext_typoscript_setup.txt (revision 7131) +++ typo3/sysext/indexed_search/ext_typoscript_setup.txt (working copy) @@ -48,6 +48,7 @@ defaultFreeIndexUidList = skipExtendToSubpagesChecking = 0 exactCount = 0 + targetPid.data = TSFE:id } result_link_target = Index: typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php =================================================================== --- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (revision 7135) +++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy) @@ -1341,7 +1341,7 @@ $html = $this->cObj->substituteSubpart($html, '###ADDITONAL_KEYWORD###', ''); } - $markerArray['###ACTION_URL###'] = htmlspecialchars($this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre)); + $markerArray['###ACTION_URL###'] = htmlspecialchars($this->getSearchFormActionURL()); $hiddenFieldCode = $this->cObj->getSubpart($this->templateCode, '###HIDDEN_FIELDS###'); $hiddenFieldCode = preg_replace('/^\n\t(.+)/ms', '$1', $hiddenFieldCode); // Remove first newline and tab (cosmetical issue) @@ -2395,6 +2395,38 @@ } } } + + /** + * Obtains the URL of the search target page + * + * @return string + */ + protected function getSearchFormActionURL() { + $targetUrlPid = $this->getSearchFormActionPidFromTS(); + if ($targetUrlPid == 0) { + $targetUrlPid = $GLOBALS['TSFE']->id; + } + return $this->pi_getPageLink($targetUrlPid, $GLOBALS['TSFE']->sPre); + } + + /** + * Obtains search form target pid from the TypoScript configuration + * + * @return int + */ + protected function getSearchFormActionPidFromTS() { + $result = 0; + if (isset($this->conf['search.']['targetPid']) || isset($this->conf['search.']['targetPid.'])) { + if (is_array($this->conf['search.']['targetPid.'])) { + $result = $this->cObj->stdWrap($this->conf['search.']['targetPid'], $this->conf['search.']['targetPid.']); + } + else { + $result = $this->conf['search.']['targetPid']; + } + $result = intval($result); + } + return $result; + } }