Hi and thank you for your code, but i don't understand where you mean that...i tried it in my custom box bm_categories_subcatonly.php
Code: Select all
class bm_categories_subcatonly extends abstract_block_module {
const CONFIG_KEY_BASE = 'MODULE_BOXES_CATEGORIES_SUBCATONLY_';
function execute() {
global $current_category_id, $category_tree;
$subcategory_tree = new category_tree();
$subcategory_tree->set_root_id($current_category_id);
$display = new tree_display($subcategory_tree);
$display->setPath($GLOBALS['cPath'], '<strong>', '</strong>');
$display->setMaximumLevel((int)MODULE_BOXES_CATEGORIES_SUBCATONLY_MAX_LEVEL);
$display->setChildString('', '');
$category_name = $category_tree->get($current_category_id, 'name');
$tpl_data = ['group' => $this->group, 'file' => __FILE__];
include 'includes/modules/block_template.php';
}
protected function get_parameters() {
return [
'MODULE_BOXES_CATEGORIES_SUBCATONLY_STATUS' => [
'title' => 'Enable Categories Module',
'value' => 'True',
'desc' => 'Do you want to add the module to your shop?',
'set_func' => "tep_cfg_select_option(['True', 'False'], ",
],
'MODULE_BOXES_CATEGORIES_SUBCATONLY_CONTENT_PLACEMENT' => [
'title' => 'Content Placement',
'value' => 'Left Column',
'desc' => 'Should the module be loaded in the left or right column?',
'set_func' => "tep_cfg_select_option(['Left Column', 'Right Column'], ",
],
'MODULE_BOXES_CATEGORIES_SUBCATONLY_MAX_LEVEL' => [
'title' => 'Maximum Level of Nesting',
'value' => '1',
'desc' => 'If you increase this number, subcategories will show in the module output.',
],
'MODULE_BOXES_CATEGORIES_SUBCATONLY_SORT_ORDER' => [
'title' => 'Sort Order',
'value' => '0',
'desc' => 'Sort order of display. Lowest is displayed first.',
],
];
}
}
It works exaktly as my code (so i do not have to change core, thats good
) but the problem is still the same. All links are only to the category and not the path (index.php?cPath=579 instead of index.php?cPath=579_80) and so the breadcrump is wrong....
what i need to achieve is to have only the subtree in this box, but my "->setRootCategoryID" do that, but breadcrum and links does affect this also, so this is not the solution. Thank you for your help