Hello all, I need some advice. It is possible to adjust <?php echo submenu() ?> to display links as well as the function <?php echo toc(2,3);?>, ie so that all links are still visible?
Thank you for your ideas.
Josef
Funkcion submenu
Moderator: mikey
Funkcion submenu
Nobody knows how much time he has left ...
http://oldnema.compsys.cz/en/?Demo_templates
http://oldnema.compsys.cz/en/?Demo_templates
Re: Funkcion submenu
Hi Josef!
I assume you want to have the submenu show all subpages including the subpages of the subpages; basically, a toc(x,3), where x is the menulevel of the first child of the current page. In other words, a nested submenu. That would be easy. Just use the following function (this is a modified submenu() of CMSimple_XH 1.6.7):
I assume you want to have the submenu show all subpages including the subpages of the subpages; basically, a toc(x,3), where x is the menulevel of the first child of the current page. In other words, a nested submenu. That would be easy. Just use the following function (this is a modified submenu() of CMSimple_XH 1.6.7):
Code: Select all
function nested_submenu()
{
global $s, $cl, $l, $tx, $cf;
$ta = array();
if ($s > -1) {
$tl = $l[$s] + 1 + $cf['menu']['levelcatch'];
for ($i = $s + 1; $i < $cl; $i++) {
if ($l[$i] <= $l[$s]) {
break;
}
if ($l[$i] <= $tl) {
if (!hide($i)) {
$ta[] = $i;
}
}
}
if (count($ta) != 0) {
$level = min($cf['menu']['levels'] + 1, 6);
return '<h' . $level . '>' . $tx['submenu']['heading']
. '</h' . $level . '>'
. li($ta, $l[$s] + 1);
}
}
}
Christoph M. Becker – Plugins for CMSimple_XH
Re: Funkcion submenu
Thank you for the quick response, just do not know to which group I'm yours embed code.
Nobody knows how much time he has left ...
http://oldnema.compsys.cz/en/?Demo_templates
http://oldnema.compsys.cz/en/?Demo_templates
Re: Funkcion submenu
You can put the code in template.htm (at the top), enclosed in <?php ... ?> like so:oldnema wrote:[…], just do not know to which group I'm yours embed code.
Code: Select all
<?php
function nested_submenu()
{
// rest of code as above
}
?>
Christoph M. Becker – Plugins for CMSimple_XH