I had the need to show submenu in my pages but with no "Submenu" title.
Searching here and all over the net I have not found a simple solution so I changed tplfuncs.php function <submenu()> like this:
Code: Select all
function submenu($smlb)
{
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 ($l[$i] < $tl) {
$tl = $l[$i];
}
}
if (count($ta) != 0) {
$level = min($cf['menu']['levels'] + 1, 6);
if ($smlb == '') {
return '<h' . $level . '>' . $tx['submenu']['heading']
. '</h' . $level . '>'
. li($ta, 'submenu');
} elseif ($smlb == 1) {
return '<h' . $level . '>'
. '</h' . $level . '>'
. li($ta, 'submenu');
} else {
return '<h' . $level . '>' . $smlb
. '</h' . $level . '>'
. li($ta, 'submenu');
}
}
}
}
$smlb can be empty and all goes normally, (1) and label is not shown or ('any string') that will replace the usual label.
I know it's a little something simple to do, but I think it would be comfortable if it were implemented in the next _xh versions.
I think also there are other comparable situations which could be made more easily configurable with the same system without the need to add plugins.
It's only a small consideration and I'd love to know what you think...
Thanx