Index: typo3/sysext/cms/tslib/class.tslib_menu.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_menu.php (revision 6054) +++ typo3/sysext/cms/tslib/class.tslib_menu.php (working copy) @@ -807,13 +807,20 @@ $sys_language_uid = intval($GLOBALS['TSFE']->sys_language_uid); } else $sys_language_uid=0; - $selectSetup = Array( - 'pidInList'=>$this->id, - 'orderBy'=>$altSortField, - 'where' => 'colPos=0 AND sys_language_uid='.$sys_language_uid, - 'andWhere' => 'sectionIndex!=0' - ); - switch($this->mconf['sectionIndex.']['type']) { + $sectionIndexSelectWhere = 'colPos = 0 AND sys_language_uid = ' . $sys_language_uid; + // modify the default "where" clause for the sectionIndex option + if ($this->mconf['sectionIndex.']['where'] || $this->mconf['sectionIndex.']['where.']) { + $sectionIndexSelectWhere = $GLOBALS['TSFE']->cObj->stdWrap($this->mconf['sectionIndex.']['where'], $this->mconf['sectionIndex.']['where.']); + } + + $selectSetup = array( + 'pidInList' => $this->id, + 'orderBy' => $altSortField, + 'where' => $sectionIndexSelectWhere, + 'andWhere' => 'sectionIndex != 0' + ); + + switch ($this->mconf['sectionIndex.']['type']) { case 'all': unset($selectSetup['andWhere']); break;