Hi,
We purchased the Metronic template package and I have a query regarding the menu/navigation system.
I am working from the Metronic html demo 20 and I can see depending on which page you are on, the menu-link active class is hard coded in the appropriate menu item so you can see where you are within the navigation.
Looking at the source files (menu.js) and the documentation (https://preview.keenthemes.com/html/metronic/docs/general/menu/api) it appears that this should be handled dynamically for you?
Can you tell me how it can be implemented please?
I have recreated the Metronic html demo 20 theme in a asp.net core 6 razor page project and the menu/navigation is in the layout page if that helps.
Many thanks
Richard
Hi,
Thank you for choosing Metronic.
As I understood you are building a classic web application using Asp.net.
In your case the menu active links should be set using these classes: active
- current active page link, here
- the active page link's parents. Basically, you should add a condition in your menu HTML code generation on the backend code in order to set the current page's menu link.
If you use JS to set an active link then users may notice a delay before the active menu link sets as active.
Regards.
Hi, sorry I'm not sure if my question came across correctly. In the Metronic source files there is a menu.js file that looks to set the active menu item, however I'm not sure how to implement it?
Sorry Sean, please ignore, I think I have figured it out.
Hi ,
Glad to hear that. If you need any further help please let us know.
Have a great day and all the best with your projects!
Regards.