I wanted to have a navigation menu as a selectbox, what seems to be something quite practical for mobile sites (see e.g. http://www.touchtech.co.nz/ and resize your browser to a narrow width). I found that all I have to is to write a simple alternative to li(), copy the toc() code and change only the call to li() to my alternative li(). I can include this definitions to a mobile template. But if some functionality of toc() might change in the future, the new toc() has to be adapted. That's currently a problem with xtoc(), as even xtoc28 doesn't regard the new "Hidden pages toc" setting. So what about adding an optional parameter to toc() which can be given an alternative li() function? So toc() could be changed to:
Code: Select all
function toc($start = NULL, $end = NULL, $li = 'li') {
...
return call_user_func($li, $ta, $start);
}
Christoph