This topic contains 5 replies, has 3 voices, and was last updated by Sean Sean 2 years, 2 months ago.

Sidebar Collapse & Expand


  • ruarco
    Participant

    Posts: 8
    Member Reply #4961

    Hi,

     

    Please confirm, i see that the sidebar does not work from version: 4.5.1

    When collapsing it it collapses, but does not hold it’s state, it changes back on page change.

    Please advise.

    • This topic was modified 2 years, 9 months ago by  ruarco.
    Sean
    Sean
    Keymaster

    Posts: 4527
    Support Staff Reply #4983

    Hi,

    Last time we used cookie to store sidebar state but it did not work smooth since cookie based solution has some glitch and delay on page load in setting the saved state of the sidebar menu. So ideally it can be implemented via ajax(send state to server side script to remember it user session) and apply the sidebar closed state on server side.

    If you need any further clarifications please let us know.

    Thanks.


    ruarco
    Participant

    Posts: 8
    Member Reply #4994

    Thanks. Will you be able to provide an example?

    Sean
    Sean
    Keymaster

    Posts: 4527
    Support Staff Reply #5032

    Hi,

    At the moment we don’t have this example. Basically you can add simple Ajax call on the sidebar toggle click and send the sidebar state to the server side script to store server side storage. Thus you can retrieve the stored sidebar state and generate sidebar’s HTML code by adding “page-sidebar-closed” class to body element and “page-sidebar-menu-closed” class to the “page-sidebar-menu” DIV.

    I hope this info will be helpful.

    Thanks.


    itc
    Participant

    Posts: 9
    Member Reply #7589
    Sean
    Sean
    Keymaster

    Posts: 4527
    Support Staff Reply #7618

    Thanks @itc for the suggestion. However the cookie based solution has some delay before the JS code is initialized and sidebar state changed.

You must be logged in to reply to this topic.