Black Friday Super Sale!Limited Time 50% OFF for All-Access Plans
Save 50% Now

Metronic Sidbar Cookie Issue


Hi,

We have the Metronic template with support purchased

I've trying to get the sidebar in the template to either stay minimised or expanded based on clicking the toggle icon. Whenever the page is refreshed it reverts back to the default display and not the last toggle setting.

The following is what I have setup:

<body id="kt_app_body" data-kt-app-page-loading-enabled="true" data-kt-app-page-loading="on" data-kt-app-layout="light-sidebar" data-kt-app-header-fixed="false" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-minimize="on" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" data-kt-app-toolbar-fixed="true" class="app-default">

<div id="kt_app_sidebar_toggle"
class="app-sidebar-toggle active btn btn-icon btn-shadow btn-sm btn-color-muted btn-active-color-primary h-30px w-30px position-absolute top-50 start-100 translate-middle rotate "
data-kt-toggle="true"
data-kt-toggle-state="active"
data-kt-toggle-target="body"
data-kt-toggle-name="app-sidebar-minimize">
<i class="ki-outline ki-black-left-line fs-3 rotate-180"></i>
</div>

I can see the following Cookie which doesn't change: sidebar_minimize_state = off

Am I missing something?

Thanks,
Kal.


Text formatting options
Submit

Replies (2)


This looks like a common issue with the sidebar state not being saved. Metronic usually stores the toggle state in localStorage, not just cookies, so the sidebar_minimize_state cookie may not update. Make sure the Metronic JS bundle is loaded correctly and that KTAppSidebar is initialized. Also check that no custom JS or cache is overriding the saved state on page load.



Hi Kal,

Sorry for the delay. We have replied to your previous post.

Thanks


Text formatting options
Submit
Text formatting options
Submit