1

I need to keep the sidebar menu hidden by default at all times, so that when the user clicks the toggle button it'll display the collapsed menu(nav-sm).

In other words, I need the same behavior the mobile mode has, in all devices. I tried a lot, but couldn't make any progress!

Danf
  • 1,409
  • 2
  • 21
  • 39

2 Answers2

1

Not sure if anyone is having this issues, but here is what I found:

The nav-sm, nav-md and nav-lg classes define the style of the sidebar. Now, the nav-md is original mode of gentelella, and it hides de sidebar for small devices. I does this using a @media query:

@media (max-width: 991px) {
    .nav-md .container.body .right_col,
    .nav-md .container.body .top_nav {
        width: 100%;
        margin: 0
    }
    .nav-md .container.body .col-md-3.left_col {
        display: none
    }
    .nav-md .container.body .right_col {
        width: 100%;
        padding-right: 0
    }
    .right_col {
        padding: 10px !important
    }
}

If you do the same things outside the query, it'll override the original styles and the sidebar will work the same in any device... This is what I wanted, albeit I'm sure is a rather ugly way of doing it. If anyone sees this and has a better understanding of things i'd appreciate some comments.

PS: this actually creates a new problem with the blue background at the bottom of the page. But that's another story.

This is useful: https://misc.laboradian.com/dashboard-sample/1/

Danf
  • 1,409
  • 2
  • 21
  • 39
0

you can crate a nav.php and put nav-sm property in your code, then make a include in your`s indexwhatever.php...

JD AS
  • 1
  • Please improve your answer with example and concrete solution, https://stackoverflow.com/help/how-to-answer – ponsfrilus Sep 15 '20 at 17:00
  • This is an old question, so the title I used was not the best, but I wasn't using php, it was all html and css. Thanks anyway! – Danf Sep 16 '20 at 18:11