See Download
http://www.phpwcms.de/index.php?download
There is a small patch available.
Usage:
{NAV_ROW} returns a row based menu starting at site level 0 including the HOME link
{NAV_ROW:CURRENT:1} row based menu starting at CURRENT level including the CURRENT structure level name
{NAV_ROW:CURRENT:0} row based menu starting at CURRENT level without the CURRENT structure level name
{NAV_ROW:ID:1} row based menu starting at given structure level ID including the structure level name
{NAV_ROW:ID:0} row based menu starting at given structure level ID without the structure level name
--------------------------------------------------------------------
Just the beginning of introducing a very simple but effective row based navigation menu:
New replacement tags:
{NAV_ROW} = full navigation of top level 0 including HOME
{NAV_ROW_NOHOME} = same as above without HOME
put in content.func.inc.php around line 275 (after breadcrum replacement):
Code: Select all
// -------------------------------------------------------------
// Simple row based navigation
if( ! ( strpos($content["all"],'{NAV_ROW')===false ) ) {
$content["all"] = str_replace('{NAV_ROW}', nav_level_row(0), $content["all"]);
$content["all"] = str_replace('{NAV_ROW_NOHOME}', nav_level_row(0,0), $content["all"]);
}
// -------------------------------------------------------------
Code: Select all
// -------------------------------------------------------------
function nav_level_row($act_cat_id, $show_home=1) {
//returns a simple row based navigation
$nav = '';
if($show_home) {
if($GLOBALS['content']["cat_id"] == $act_cat_id) {
$before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
$after = $GLOBALS['template_default']["nav_row"]["link_after_active"];
} else {
$before = $GLOBALS['template_default']["nav_row"]["link_before"];
$after = $GLOBALS['template_default']["nav_row"]["link_after"];
}
$nav .= $before;
$nav .= '<a href="index.php?';
$nav .= ($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_alias']) : 'id='.$act_cat_id.',0,0,1,0,0';
$nav .= '">'.html_specialchars($GLOBALS['content']['struct'][$act_cat_id]['acat_name']).'</a>';
$nav .= $after;
}
foreach($GLOBALS['content']['struct'] as $key => $value) {
if($GLOBALS['content']['struct'][$key]["acat_struct"] == $act_cat_id && $key != $act_cat_id && !$GLOBALS['content']['struct'][$key]['acat_hidden']) {
if($nav) $nav .= $GLOBALS['template_default']["nav_row"]["between"];
if($GLOBALS['content']["cat_id"] == $key) {
$before = $GLOBALS['template_default']["nav_row"]["link_before_active"];
$after = $GLOBALS['template_default']["nav_row"]["link_after_active"];
} else {
$before = $GLOBALS['template_default']["nav_row"]["link_before"];
$after = $GLOBALS['template_default']["nav_row"]["link_after"];
}
$nav .= $before;
$nav .= '<a href="index.php?';
$nav .= ($GLOBALS['content']['struct'][$key]['acat_alias']) ? html_specialchars($GLOBALS['content']['struct'][$key]['acat_alias']) : 'id='.$key.',0,0,1,0,0';
$nav .= '">'.html_specialchars($GLOBALS['content']['struct'][$key]['acat_name']).'</a>';
$nav .= $after;
}
}
$nav = $GLOBALS['template_default']["nav_row"]["before"].$nav.$GLOBALS['template_default']["nav_row"]["after"];
return $nav;
}
// -------------------------------------------------------------
Code: Select all
// row based navigation
$template_default["nav_row"]["before"] = '';
$template_default["nav_row"]["after"] = '';
$template_default["nav_row"]["between"] = ' | ';
$template_default["nav_row"]["link_before"] = '';
$template_default["nav_row"]["link_after"] = '';
$template_default["nav_row"]["link_before_active"] = '<span style="text-decoration:none;font-weight:bold;">';
$template_default["nav_row"]["link_after_active"] = '</span>';
Code: Select all
// row based navigation
$template_default["nav_row"]["before"] = '<table cellspacing="0" cellpadding="3" border="0" bgcolor="#FFFFFF"><tr>';
$template_default["nav_row"]["after"] = '</tr></table>';
$template_default["nav_row"]["between"] = "\n";
$template_default["nav_row"]["link_before"] = '<td>';
$template_default["nav_row"]["link_after"] = '</td>';
$template_default["nav_row"]["link_before_active"] = '<td bgcolor="#DDDDDD" style="text-decoration:none;font-weight:bold">';
$template_default["nav_row"]["link_after_active"] = '</td>';
Have fun:
Oliver