Index: branches/5.2.x/core/units/categories/categories_tag_processor.php =================================================================== diff -u -N -r15720 -r15734 --- branches/5.2.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 15720) +++ branches/5.2.x/core/units/categories/categories_tag_processor.php (.../categories_tag_processor.php) (revision 15734) @@ -1,6 +1,6 @@ Application->recallObject($this->Prefix . '.-virtual', null, $params); + $page = $this->Application->recallObject($this->Prefix . '.' . $this->_getPageSpecial($params), null, $params); /* @var $page kDBItem */ // 1. load by given id - $page_id = array_key_exists('page_id', $params) ? $params['page_id'] : false; - if ($page_id) { - if ($page_id != $page->GetID()) { + $page_id = array_key_exists('page_id', $params) ? $params['page_id'] : 0; + + if ( $page_id ) { + if ( $page_id != $page->GetID() ) { // load if different $page->Load($page_id); } @@ -1157,15 +1158,16 @@ // 2. load by template $template = array_key_exists('page', $params) ? $params['page'] : ''; - if (!$template) { + + if ( !$template ) { $template = $this->Application->GetVar('t'); } - // different path in structure AND design template differes from requested template - $structure_path_match = mb_strtolower( $page->GetDBField('NamedParentPath') ) == mb_strtolower('Content/' . $template); + // different path in structure AND design template differs from requested template + $structure_path_match = mb_strtolower($page->GetDBField('NamedParentPath')) == mb_strtolower('Content/' . $template); $design_match = $page->GetDBField('CachedTemplate') == $template; - if (!$structure_path_match && !$design_match) { + 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 */ @@ -1179,6 +1181,30 @@ } /** + * Returns unique special for each used page + * + * @param Array $params + * @return string + * @access protected + */ + protected function _getPageSpecial($params) + { + $ret = Array (); + $page_id = array_key_exists('page_id', $params) ? $params['page_id'] : 0; + $template = array_key_exists('page', $params) ? $params['page'] : ''; + + if ( $page_id ) { + $ret[] = 'page_id=' . $page_id; + } + + if ( $template ) { + $ret[] = 'page=' . $template; + } + + return $ret ? '-virtual-' . kUtil::crc32(serialize($ret)) : '-virtual'; + } + + /** * Returns requested content block content of current or specified page * * @param Array $params