Hi,
no patch today - only for testing to anybody who wants to test this:
I extend the NAV_TABLE_COLUMN function to handle different level starting points.
What is it doing:
{NAV_TABLE_COLUMN} = system replaces with {NAV_TABLE_COLUMN:0} what means start at Top Level.
But now you can take any CAT-ID (in admin site structure) to start navigation at that given level. {NAV_TABLE_COLUMN:3}
change function nav_table_struct() in front.func.inc.php:
Code: Select all
function nav_table_struct ($struct, $act_cat_id, $level, $nav_table_struct, $link_to="index.php") {
// start with home directory for the listing = top nav structure
// 1. Build the recursive tree for given actual article category ID
// return the tree starting with given start_id (like breadcrumb)
// if the $start_id = 0 then this stops because 0 = top level
$start_id = $act_cat_id;
while ($start_id) {
$data[$start_id] = 1;
$start_id = $struct[$start_id]["acat_struct"];
}
$temp_tree = (sizeof($data)) ? array_reverse($data, 1) : false;
foreach($struct as $key => $value) {
if($struct[$key]["acat_struct"] == $act_cat_id && $key && !$struct[$key]["acat_hidden"]) $c++;
}
$c = (!$c) ? 1 : 0;
//get depth of level
$level_depth = 0; $start_level = $level;
while ($start_level) {
$start_level = $struct[$start_level]["acat_struct"];
$level_depth++;
}
$temp_menu = build_levels ($struct, $level, $temp_tree, $act_cat_id, $nav_table_struct, $level_depth, $c, $link_to); //starts at root level
return ($temp_menu) ? ("<table".table_attributes($nav_table_struct, "table", 0).">\n".$temp_menu."</table>") : "";
}
Code: Select all
// Left table based rollover navigation
if( ! ( strpos($content["all"],'{NAV_TABLE_COLUMN')===false ) ) {
$content["all"] = str_replace('{NAV_TABLE_COLUMN}', '{NAV_TABLE_COLUMN:0}', $content["all"]); //content
$replace = 'nav_table_struct($content["struct"],intval($content["cat_id"]),intval($1),$template_default["nav_table_struct"]);';
$content["all"] = preg_replace('/\{NAV_TABLE_COLUMN:(\d+)\}/e', $replace, $content["all"]);
}
Have fun. It runs stable.
Oliver