SPA Dashboard - Vertical Menu

Hey!

I am working on SPA Dashboard. I found the Dynamic Offcanvas BS5. But I woul like to have it fixed. When I make a vertical menu, does not stay fixed.

I would like something like this: http://medic-app.type-code.pro/#/vertical/default-dashboard

I found a free dashboard template. but when I copy de code it comes under the CONTENT PAGE.

Any solution?

Thanks

Copy the code from
https://getbootstrap.com/docs/5.0/examples/dashboard/

Hey Ben!

I did that, but how is a SPA the position is on the top or on the bottom.

Sorry, I do not understand the question, probably because some important info is missing.

What I gather is that you want to create a single page app for an admin section.

  1. Which server model are you using (PHP, NodeJS, …)?
  2. What do you mean when you say top or bottom?
  1. NodeJS
  2. How can I put the content page(in your example the chart and the table) on the right side of the sidebar and under the top bar?

The red area is where want the content.

I followed your tutorial on how to import bootstrap templates. But I could not make it work. Using Bootstrap Source Files

Thanks for all the help :slight_smile:

Please follow:

it explains how to setup the template page where you need the menu, and how to include content pages there.

Hey Teodor!

Yes, I followed this one to make work the SPA. And everything works perfectly. What I can’t make is put a fixed sidebar on the left side without moving the content page down.

I have tried to make a container-row-column-column. In one column the sidebar and in the other the page content.

Thanks

This means you have not correctly styled it. Your sidebar menu needs to be positioned using position: fixed, then you need to use margin left on the content the same values as the width of the sidebar.

I will try that. I am still learning how to stylize thins in Wappler. That is why I have difficulties understanding some things.

How is it that there is no sidebar component? Or you call it vertical navigation?

Thanks

The farthest I could get is this:


From this snippet: https://getbootstrap.com/docs/5.0/examples/sidebars/
But all the templates I check on the sidebar are not in a container.

Another thing I saw on templates is that they add the style on the top of the HTML. But I work with JS page.

Example on the template that is above:

Where I put this?

Cheers

I am not sure i understand what you mean.

this is not the correct way to add such a sidebar. It should not be placed inside a container.
It’s a direct child of the body.

I understand Teodor, the thing is that I can not find a way to do it. I followed all your tutorials related to the sidebar. And still can make it.

Now I have it the way should be in the structure of the app. Can you give me some more detailed steps to put the content area on the right side of the sidebar? Or send me some tutorial that, maybe, I missed.

Normally on the bootstrap templates, the styles are inside the HTML. But, on our webs apps, the style.css is apart.


This code is inside the index.html

How should I transform the style in HTML to a separate style.css.

Cheers

I don’t know how experienced are you with CSS, but to make a column you need the following element:

Needs to be styled using:

position: fixed;
top: 0px;
left: 0px;
height: 100vh;
width: 320px; /* that's just and example value */
z-index: 9999;

to look like you need it.

The element next to it (on the right, in your case #content) needs to be set to margin-left: 320px to compensate for the space taken by the sidebar.

that’s the simplest way i can explain it.

Also there are plenty of tutorials explaining the concept of fixed sidebars such as:
https://www.w3schools.com/howto/howto_css_fixed_sidebar.asp

OMG! That was what I need :heart_eyes: :heart_eyes: :heart_eyes:

THANKS!!!

1 Like