Help with converting Bootstrap Menu
Posted: Thu Oct 03, 2013 4:02 pm
Hello everyone. I am trying to convert a Bootstrap template into a functional CMS Made Simple. I think I have almost everything working except (of course) for the menu. Actually it is working... but it's the sub-menus (childs) and sub sub menus that don't want to coorperate with me.
I did look around of course as always, and I found several useful tips which got me to where I am now. I also found this thread where Uniq3 posted the same exact bootstrap template for download (xml). I didn't want to download, because I really wanted to take the time to understand how to customize the menu on my own.
This thread: http://forum.cmsmadesimple.org/viewtopi ... nu#p300340
Below is the simple html code from the Bootstrap template I am trying to convert over to CMSMS menu:
...And here is my CMSMS menu template so far... I just can't figure out how to get the sub menus (childs) to work properly, and child/child menus below that:
...And here is the link to the working site:
http://cicounters.com/
...click on the "About us" menu item, and the dropdown shows correctly, but try clicking on both links... only one works, than the other doesn't, and if you click more the dropdown stops showing...
I am using the latest version of CMSMS 1.11.9 and of course the latest of Bootstrap 3.0.0
I would greatly appreciate someone helping me figure this out or point out what I can try/change/modify. Thank you in advance

I did look around of course as always, and I found several useful tips which got me to where I am now. I also found this thread where Uniq3 posted the same exact bootstrap template for download (xml). I didn't want to download, because I really wanted to take the time to understand how to customize the menu on my own.
This thread: http://forum.cmsmadesimple.org/viewtopi ... nu#p300340
Below is the simple html code from the Bootstrap template I am trying to convert over to CMSMS menu:
Code: Select all
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
</ul>
</li>
</ul>
Code: Select all
{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
{assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}
{if $count > 0}
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="dropdown-menu">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string='</li></ul>' times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or $node->current == true}
{assign var='classes' value='active'}
{if $node->parent == true}
{assign var='classes' value='dropdown active'}
{/if}
{if $node->children_exist == true and $node->depth < $number_of_levels}
{assign var='classes' value=$classes|cat:' dropdown'}
{/if}
<li class="{$classes}"><a class=""
{elseif $node->type == 'sectionheader' and $node->haschildren == true}
<li class=""><a class=""><span class="sectionheader">{$node->menutext}</span><b class="caret"></b></a>
{elseif $node->type == 'sectionheader'}
<li><a><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="menu_separator" />
{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"
{else}
<li>
<a
{/if}
{if ($node->type != 'sectionheader' and $node->type != 'separator') or $node->parent == true or $node->current == true }
{if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string='</li></ul>' times=$node->depth-1}
</li>
</ul>
</div>
{/if}
http://cicounters.com/
...click on the "About us" menu item, and the dropdown shows correctly, but try clicking on both links... only one works, than the other doesn't, and if you click more the dropdown stops showing...

I am using the latest version of CMSMS 1.11.9 and of course the latest of Bootstrap 3.0.0
I would greatly appreciate someone helping me figure this out or point out what I can try/change/modify. Thank you in advance
