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

angular > metronic 8.1.7 > Sidebar


Hi,

I want to set the mobile like sidebar toggle option in all view (and disable large screen layout), can you help me to change related settings values or configs to do so ?

(in mobile the sidebar panel is hidden toggled when click "Show sidebar menu" )


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi Rohan Mistry

Update the drawer activation setting in your layout configuration files. The key setting is data-kt-drawer-activate in the sidebar drawer configuration.

src/app/_metronic/layout/core/configs/
Files to update:
dark-sidebar.config.ts
light-sidebar.config.ts
dark-header.config.ts
light-header.config.ts

Update the drawer activation setting — In each config file, find the sidebar.default.drawer.attributes section and change:
'data-kt-drawer-activate': '{default: true, lg: false}'
to:

"data-kt-drawer-activate": "{default: true, lg: true}"


This keeps the drawer active (mobile-like behavior) on all screen sizes, including large screens.
Make the toggle button visible on all screens — In src/app/_metronic/layout/components/header/header.component.html, find the sidebar mobile toggle button and remove the d-lg-none class:

<!-- Change from: -->
<div class="d-flex align-items-center d-lg-none ms-n2 me-2" title="Show sidebar menu">

<!-- To: -->
<div class="d-flex align-items-center ms-n2 me-2" title="Show sidebar menu">


After making these changes, clear your browser cache and reload the application. If the sidebar still doesn't behave as expected, share which layout type you're using (dark-sidebar, light-sidebar, dark-header, or light-header)



It looks like the attached image after making changes as suggested, any other settings to change to show it exactly like mobile layout ?

1. left side big margin gap showing
2. when showing side bard does not show menu bar links (only icons)

let me know if you are not able to see the images

<img src=" 1</img>

<img src=" 2</img>



fyi: its about margin for

[data-kt-app-sidebar-fixed=true] .app-wrapper

body:not([data-kt-app-header-fixed="true"])[data-kt-app-sidebar-fixed="true"][data-kt-app-sidebar-push-header="true"] &,
body:not([data-kt-app-header-fixed="true"])[data-kt-app-sidebar-sticky="on"][data-kt-app-sidebar-push-header="true"] & {
margin-left: calc(
var(--#{$prefix}app-sidebar-width) +
var(--#{$prefix}app-sidebar-gap-start, 0px) +
var(--#{$prefix}app-sidebar-gap-end, 0px)
);
}


similarly for header too.



Also is it possible on desktop sidebar, i can extend the time of the hover over menu to open it...
like it is right now opening as soon as mouse over it... is it possible to do by 2 seconds over side bar and then open it ?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(