dynamic menu question

6 posts by 3 authors in: Forums > CMS Builder
Last Post: October 9, 2009   (RSS)

Re: [equinox69] dynamic menu question

By Kenny - October 3, 2009

We have successfully implemeted this script before. Check it out and see if it is what ou are talking about?

http://www.dynamicdrive.com/dynamicindex1/slashdot.htm


Kenny

Re: [sagentic] dynamic menu question

By Codee - October 4, 2009

Did you do it in conjunction with the automatic category setup with CMSB? So when you add/delete items to a category/subcategory field your dynamic menus changed as well?

Re: [equinox69] dynamic menu question

By Chris - October 5, 2009

Hi equinox69,

Can you please post the PHP source code for the page you want to add this feature to?
All the best,
Chris

Re: [chris] dynamic menu question

By Chris - October 5, 2009 - edited: October 5, 2009

Hi Terry,

I checked out the page that you sent via private message and it looks like you're outputting nested <ul>s, which is exactly what you'd want to start with.

This isn't something that CMS Builder will do for you, but it's certainly something you can do with CMS Builder's output and a little Javascript. I'd suggest using jQuery. Here's a little example to get you started:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<ul class="nested">
<li><a href="#" class="toggle">+</a> <a href="#">Manufacturer 1</a>
<ul>
<li>Model 1a</li>
<li>Model 1b</li>
<li>Model 1c</li>
</ul>
</li>
<li><a href="#" class="toggle">+</a> <a href="#">Manufacturer 2</a>
<ul>
<li>Model 2a</li>
<li>Model 2b</li>
<li>Model 2c</li>
</ul>
</li>
</ul>

<script>
$(document).ready(function(){
$(".nested > li > ul").hide();
$(".nested > li > a.toggle").click(
function () {
$(this).parent().find('ul').toggle();
}
);
});
</script>


There are plenty of tutorials on the web to help you or your web developer build "accordion menus" with jQuery.

We can't really support custom Javascript, but I wanted to give you an idea of what's possible. I hope this helps!
All the best,
Chris

Re: [chris] dynamic menu question

By Codee - October 9, 2009

Chris,
Thank you SO much for giving time and the input. I'll work on it.

Cheers!