Index: trunk/core/kernel/event_handler.php =================================================================== diff -u -r3872 -r4137 --- trunk/core/kernel/event_handler.php (.../event_handler.php) (revision 3872) +++ trunk/core/kernel/event_handler.php (.../event_handler.php) (revision 4137) @@ -190,8 +190,20 @@ $ret .= $processed_params[$prefix_special.'_Page'].'/'; } - if($processed_params[$prefix_special.'_id']) - { + if ($processed_params[$prefix_special.'_id']) { + + // this allows to fill 3 cache records with one query (see this method for details) + $category_id = isset($url_params['m_cat_id']) ? $url_params['m_cat_id'] : $this->Application->GetVar('m_cat_id'); + $category_filename = $this->Application->getFilename('c', $category_id); + + // if template is also item template of category, then remove template + $template = getArrayValue($url_params, 't'); + $item_template = $this->Application->getCache('item_templates', $category_id); + if ($template == $item_template) { + unset($url_params['t']); + } + + // get item's filename $filename = $this->Application->getFilename($event->Prefix, $processed_params[$prefix_special.'_id'] ); if($filename !== false) $ret .= $filename.'/'; }