Hello I just bought Good Theme html5 version, but can't figure out how to set automatically left menu items as "active" on every page load, maybe through a javascript. Can you help?
thanks a lot
Can I have a JS anyway?
Can you please replace core/html/src/js/components/menu.js
with https://keenthemes.ams3.digitaloceanspaces.com/downloads/menu.js and recompile your assets with gulp or webpack then you can use the KTMenu's new API method as:
var activeLink = menu.getLinkByAttribute("/users/group/add");
menu.setActiveLink(activeLink);
KTMenu.updateByLinkAttribute("/users/group/add");
Hi,
Usually, this is handled in the server-side code by adding required classes to the active menu link and its parents as you can see in this examples.
If you use JS to set the active menu link, it can be noticeable that the menu active item is set after page load and the delay can be 2-3seconds. If you use the server-side approach it will be an instance with the page load.
Regards.