New Metronic Docs!Added Integration Docs with Starter Kits Apps for Laravel, Laravel Livewire, Angular, Vue, Symfony, Blazor Server, Django & Flask & more
Browse Docs

Sidebar minimization problem


Hi Metronic team, I havea problem with sidebar minimization I have downloaded the latest file from the site in metronic for sidebar.js but I am originally using I am using metronic Bootstrap and HTML version v8.2.7. no matter what I do the sidebar doesn't keep it's stauts it's always open even I have tried to change the value in the cookies to off instead of on and the same problem I want the side bar to save it's status. can you tell me how to make it save it's status and what can I do if I want to overwrite or alter some of it's behavior, knowing it work in any page but in any referesh it returns to it's original status which is opened


Text formatting options
Submit

Replies (1)


Hi,

Sorry for the late reply.

In sidebar.js there is a code that sets cookie value on sidebar toggle. You will need to check this cookie value in server side and add data-kt-app-sidebar-minimize="on" attribute to the body tag during the server side generation of the HTML.

Then add data-kt-toggle-state="active" to the sidebar toggle button and also add "active" class to the toggle button.

Regards,
Sean


Text formatting options
Submit
Text formatting options
Submit