The menu bolt on Automatic Menu Opening Module works great if you only use a single menu on your site. However, I'm using two menus on every page: http://vault.hanover.edu/~stilson/hanover/about/
I need only the left-side collapsible menu to be automatically opened - not the header menu at the top.
Is there anyway to tweak this function to pass it a specific menu to use?
Better yet, to indicate which menu style to use so that it will work for all menus using the style?
Thanks!
Ben
open specific menu by url
Hi,
I don't know that you could tweak it. I think the code would have to be re-written since the module was written to use the menu programming to open the submenus. It probably uses some of the internal programming that is there to make the page highlighting work. I wanted to respond so you didn't think we were just ignoring you But, it may not be possible, or it may be excessively time-consuming to try and 'tweak' the module.
Ruth
I don't know that you could tweak it. I think the code would have to be re-written since the module was written to use the menu programming to open the submenus. It probably uses some of the internal programming that is there to make the page highlighting work. I wanted to respond so you didn't think we were just ignoring you But, it may not be possible, or it may be excessively time-consuming to try and 'tweak' the module.
Ruth
I was thinking about this and I had a thought that might work, it really depends on just how many pages you have and whether you want to use another directory. If you had a different directory for the treemenu pages and the main menu pages, openmenusbyurl would work exactly as you wanted it to work.
Ruth
Ruth
Ruth,
I think I found a way to "cheat" the openmenusbyurl.js add-on to achieve what I want.
I don't fully understand how it works, but it seems to work perfectly. Here is the code:
The function somehow counts all the menus on the page then loops over them all to determine which one to display. I haven't figured it out exactly, but if I limit the menu looping count to a certain number, I can get the function to work the way I want it to.
It's a hack, but it seems to work. I call the "_ocURL" function in the BODY tag with onLoad. I included a conditional statement to check if the number I pass in is greater then the main header menu count - if it's greater, then display the other menus.
It's ugly and as I said I don't fully understand it, but it works (for now).
What do you think?
Ben
PS. I'll try your suggestion today. Thanks.
I think I found a way to "cheat" the openmenusbyurl.js add-on to achieve what I want.
I don't fully understand how it works, but it seems to work perfectly. Here is the code:
Code: Select all
//function _ocURL()
function _ocURL(mnum) //my change
{
var max_m = mnum; //added
_ombcu=new Array()
if(_cip.length>0){
for(_c=0;_c<_cip.length;_c++){
_ci=_cip[_c];
_mni=getParentItemByItem(_ci);
if(_mni==-1)_mni=_ci
if(_mni+" "!=$u){
while(_mni!=-1){
_ombcu[_ombcu.length]=_mni;
_mni=getParentItemByItem(_mni);
if(_mni+" "==$u)_mni=-1
}
}
}
}
if(_startM){
//setTimeout("_ocURL()", 10)
setTimeout("_ocURL("+max_m+")", 10) //my change
}
else
{
if(_ombcu.length){
for(_oma=_ombcu.length-1;_oma>-1;_oma--){
if(_ombcu[_oma]>max_m){ //added
_popi(_ombcu[_oma])
clickAction(_ombcu[_oma])
}//
_ofMT=1
if(_oma==_W.mm_maxLevels)return
}
}
}
}
//_ocURL()
It's a hack, but it seems to work. I call the "_ocURL" function in the BODY tag with onLoad. I included a conditional statement to check if the number I pass in is greater then the main header menu count - if it's greater, then display the other menus.
It's ugly and as I said I don't fully understand it, but it works (for now).
What do you think?
Ben
PS. I'll try your suggestion today. Thanks.