Index: branches/RC/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r11520 -r11523 --- branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11520) +++ branches/RC/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 11523) @@ -1020,9 +1020,17 @@ if (!$structure_path_match && !$design_match) { // Same sql like in "c:getPassedID". Load, when current page object doesn't match requested page object + $themes_helper =& $this->Application->recallObject('ThemesHelper'); + /* @var $themes_helper kThemesHelper */ + $sql = 'SELECT ' . $page->IDField . ' FROM ' . $page->TableName . ' - WHERE (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')'; + WHERE + ( + (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR + (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ') + ) + AND (ThemeId = ' . $themes_helper->getCurrentThemeId() . ' OR ThemeId = 0)'; $page_id = $this->Conn->GetOne($sql); $page->Load($page_id);