This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 2 years, 4 months ago.

How to set a sidebar menu item selected?

  • iluego

    Posts: 6
    Member Reply #7469

    My question is about how to set ‘active’ and ‘open’ on the selected item. Now I select either of the 2 first items and always is selected the first one. (image attached with the code)

    • This topic was modified 2 years, 4 months ago by  iluego.
    You must be logged in to view attached files.

    Posts: 4527
    Support Staff Reply #7484


    You will need to control it in your server side code while you generate you pages. To set active state you will need to programmatically set the “active” and “open” classes following the code. Please note this is not handled by Metronic’s JS code. You will need to handle it with your server side code(php or whatever language you use). Basically you can add a condition for each menu node and apply “active” and “open” classes accordingly.

    If you need any further clarifications please let us know.


You must be logged in to reply to this topic.