Page 1 of 1

Site migration - issue with Menu [SOLVED]

Posted: Sat Mar 14, 2015 8:44 am
by wmdvanzyl
Hi All.

I was asked to port this site to CMSMS:
Original: http://modh.co.za/peggystatic
CMSMS: http://peggy.modh.co.za

Please don't talk about the design decisions - clients are adamant and it's getting worse... anyyyyway.

What i need help on is this:

If you look at the original, you can see that clicking on a menu item sets the CSS class to "active" changing the background colour.

In the ported version this behavior doesn't work.

I have reached the point where i think i can attribute the behavior to the Twitter Bootstrap framework that they started with (bootstrap.min.js), but i don't know how to debug or investigate the issue further.

Any advice on a good way to find out what is going wrong will be appreciated.

Re: Site migration - issue with Menu

Posted: Sat Mar 14, 2015 11:17 am
by staartmees
I see your Home-link is always marked as class="active"

Which menu.tpl are you using?

Re: Site migration - issue with Menu

Posted: Sat Mar 14, 2015 11:24 am
by wmdvanzyl
I just used their static menu structure and made a new menu template. Home starts out as being active and then the idea is that using javascript the class needs to be removed from that element and addded to the one that was selected, but my javascript-foo is baaaad. :(

Should i post the menu code?

Re: Site migration - issue with Menu

Posted: Sat Mar 14, 2015 11:31 am
by staartmees
it's better to use one of the menu templates that comes with your cmsms.

Re: Site migration - issue with Menu

Posted: Sat Mar 14, 2015 3:59 pm
by velden
wmdvanzyl wrote:I just used their static menu structure and made a new menu template. Home starts out as being active and then the idea is that using javascript the class needs to be removed from that element and addded to the one that was selected, but my javascript-foo is baaaad. :(

Should i post the menu code?
I think it's a misconception that javascript should be used to do that. It's not true.

It's the task of the menu template to set the proper class for the current/active. Have a look at the sample menu templates how to accomplish that.

Looking at your static pages: those have the class set in the source too.

Re: Site migration - issue with Menu

Posted: Sun Mar 15, 2015 5:15 pm
by wmdvanzyl
Thanks velden and smartmees for the reply. I never realised this! I definitely need to spend time getting to know and understand the menu manager better.

I will check it out - thanks!

EDIT: Took your advice and started with one of the included menu templates. Then added the classes on that the new menu uses. A few adjustments and voila! Works.