{NAV_TABLE_COLUM:id} how?
Posted: Fri 1. Jul 2005, 14:38
i created a site with two languages
home
- german (id=de)
- english (id=en)
if i use the {NAV_TABLE_COLUM:1} menu. it always shows me the german menu, even if i am on index.php?en
In this forum I found a solution.
if somebody could give me the code of the rewritten function..
i guess ist's this one:
can someone help?
home
- german (id=de)
- english (id=en)
if i use the {NAV_TABLE_COLUM:1} menu. it always shows me the german menu, even if i am on index.php?en
In this forum I found a solution.
well I didn't get it... how do I enhance the function so the $start var gets replaced with the ID (i have no sufficent clue of php).Ok simply create 2 templates.
Have a look at: {NAV_TABLE_COLUM:x} Replacement Tag in front.func.inc.php and simply enhance your dhtmlmenu in the way, that it
replaces the $start var in your built_dhtmlmenu function with the actual Id you want.
You got it ?
hack your dhtmlmenu reptag to: dhtmlmenu:x reptag and place
dhtmlmenu:IDOFENLEVEL in your en_template and
dhtmlmenu:IDOFDELEVEL in your de_template...
if somebody could give me the code of the rewritten function..
i guess ist's this one:
Code: Select all
function build_dhtmlmenu($start=0, $class='', $activeclass='', $counter=0) {
// builds a <ul><li> list based on structure
// layout settings for $class = array(
// 'count' => 0 (if the depth should be added to class/id name)
// 'every' => 0 (if set 1 every sub-<ul> will get the class/id name
// 'ul_i' => 'mydhtmlid'
// 'ul_c' => 'mydhtmlclass'
// 'ul_ia' => 'mydhtmlactiveid'
// 'ul_c' => 'mydhtmlactiveclass'
// 'li_ca' => 'myactiveclass' (for setting different class for active <li>)
$s = '';
$g = '';
foreach($GLOBALS['content']['struct'] as $key => $value) {
//2005-03-28 Oliver Georgi
//enhanced: show also when hidden but within selected tree
if ($start == $GLOBALS['content']['struct'][$key]['acat_struct'] &&
(!$GLOBALS['content']['struct'][$key]['acat_hidden'] || isset($GLOBALS['LEVEL_KEY'][$key])) && $key)
{
$s .= '<li';
if($key == $GLOBALS['aktion'][0] && $activeclass) $s .= ' '.$activeclass;
$s .= '>';
if(!$GLOBALS['content']['struct'][$key]["acat_redirect"]) {
$s .= '<a href="index.php?';
if($GLOBALS['content']['struct'][$key]['acat_alias']) {
$s .= $GLOBALS['content']['struct'][$key]['acat_alias'];
} else {
$s .= 'id='.$key.',0,0,1,0,0';
}
$s .= '">';
} else {
$redirect = get_redirect_link($GLOBALS['content']['struct'][$key]["acat_redirect"], ' ', '');
$s .= '<a href="'.$redirect['link'].'"'.$redirect['target'].'>';
}
$s .= html_specialchars($GLOBALS['content']['struct'][$key]['acat_name']);
$s .= '</a>';
$s .= build_dhtmlmenu($key, $class, $counter+1);
$s .= "</li>\n";
}
}
if($s) {
$g = "\n<ul";
if(!$counter && $class) $g .= ' '.$class;
$g .= ">\n".$s.'</ul>';
}
return $g;
}