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

How to set a sidebar menu item selected?


  • iluego
    Participant

    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 1 year, 10 months ago by  iluego.
    Attachments:
    You must be logged in to view attached files.
    Sean
    Sean
    Keymaster

    Posts: 4482
    Support Staff Reply #7484

    Hi,

    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.

    Thanks.

You must be logged in to reply to this topic.