Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Metronic Menu/Navigation


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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


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 happy,

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.


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(