Content Right Sticky Sidebar

CSS Classes

This table contains all classes related to the content right sticky sidebar layout. This is a custom layout classes for content right sticky sidebar layout page requirements.

All these options can be set via following classes:

Classes Description
.content-right-sidebar You can create 3 column right layout by adding .content-right-sidebar class in <body> tag.
.content-left In this layout content should be float in right side, so .content-left class needs to add in content wrapper. Refer HTML markup line no 27.
.sidebar-right In this layout sidebar should be float in right side, so .sidebar-right class needs to add in sidebar wrapper. Refer HTML markup line no 33.
.sidebar-sticky To create sticky sidebar add .sidebar-sticky class. Refer HTML markup line no 34.

HTML Markup

This section contains HTML Markup to create 3 column right sticky sidebar layout. You need to add the .content-right-sidebar class in the <body> tag as show in below markup on line no 4. This layout has a navigation, content and right sidebar sections with common header & footer.

  • Line no 27: Contain the .content-left class for adjusting content section in left side.
  • Line no 33: Contain the .sidebar-right class for adjusting sidebar section in right side.
  • Line no 34: Contain the .sidebar-sticky class, that will make the right sidebar sticky.

Modern has a ready to use starter kit, you can use this layout directly by using the content-right-sticky-sidebar.html

            
                <!DOCTYPE html>
                  <html lang="en">
                    <head></head>
                    <body data-menu="vertical-menu" class="vertical-layout vertical-menu content-right-sidebar menu-expanded">
                      
                      <!-- fixed-top-->
                      <nav role="navigation" class="header-navbar navbar navbar-with-menu fixed-top navbar-dark navbar-shadow navbar-border">
                          ...
                      </nav>
                      
                      <!-- BEGIN Navigation-->
                      <div class="main-menu menu-dark menu-fixed menu-shadow">
                          ...
                      </div>
                      <!-- END Navigation-->

                      <!-- BEGIN Content-->
                      <div class="content modern-content container-fluid">
                          <div class="content-wrapper">
                              <!-- content header-->
                              <div class="content-header row">
                                  ...
                              </div>
                              <!-- content header-->
                              
                              <!-- content left-->
                              <div class="content-left">
                                  ...
                              </div>
                              <!-- content left-->
                              
                              <!-- sidebar right-->
                              <div class="sidebar-right">
                                  <div class="sidebar sidebar-sticky">
                                      ...
                                  </div>
                              </div>
                              <!-- sidebar right-->
                              
                          </div>
                      </div>
                      <!-- END Content-->


                      <!-- START FOOTER DARK-->
                      <footer class="footer footer-dark">
                          ...
                      </footer>
                      <!-- START FOOTER DARK-->

                    </body>
                  </html>
            
            

PUG Configuration

Modern Admin use PUG as template engine to generate pages and whole template quickly using node js, for getting start with PUG usage & template generating process please refer template documentation.

PUG Variables

This table contains required PUG variables to generate 3 column right sticky sidebar layout.

Variable Value Description
contentLayout 'content-right-sidebar' You need to set contentLayout variable value as 'content-right-sidebar' in pageConfig block.
sidebarSticky true You need to set sidebarSticky variable value as true in pageConfig block to enable right sticky sidebar.
PUG Code

To generate content right sticky sidebar layout page or template, you need to use following PUG code.

  • Line no 20-24: pageConfig block has a template specific configuration variables, in that for 3 column layout need to define variable - var contentLayout = 'content-right-sidebar'
  • Line no 25: To make right sticky sidebar pageConfig block also require - var sidebarSticky = true configuration variables, set value as true to enable it.
  • Line no 36-37: content block has content section html file included include ../contents/content-right-sticky-sidebar.html, which can be customizable on page level.
  • Line no 39-40: sidebar block has sidebar section html file included include ../contents/sidebar-common.html, which can be customizable on page level.

If you want to use this layout on page level you need to define it on page it self. This template has one example pug file for content right sticky sidebar content-right-sticky-sidebar.pug, however you can use it on template level but it will generate whole template as a content right sticky sidebar.

                
                  block pageVars
                    - var pageTitle    = "Content Right Sticky Sidebar"
                    - var pageSubTitle = "content layout with right sticky sidebar"
                    - var description  = "The content layout page structure with navigation, content area and right sticky sidebar."
                    - var activeMenu   = "layout-content-right-sticky-sidebar"

                  extends template

                  append pageConfig
                    - var contentLayout = 'content-right-sidebar'
                    - var sidebarSticky = true

                  append breadcrumbs
                    +breadcrumbs([{url:"index.html",name:"Home"},{url:"#",name:"Page Layouts"}, {name:"Content Right Sidebar Sticky"}])



                  //- Include page content in content block
                  append content
                    include ../contents/layout-content-detached-right-sticky-sidebar.html

                  append sidebar
                    include ../contents/sidebar-common.html

                  //- Vendor CSS
                  append vendorcss
                    link(rel='stylesheet', type='text/css', href='../app-assets/vendors/css/extensions/nouislider.min.css')
                      
                  //- Page CSS
                  append pagecss
                    link(rel='stylesheet', type='text/css', href='../app-assets/vendors/css/ui/prism.min.css')
                    //- Knob
                    link(rel='stylesheet', type='text/css', href='../app-assets/vendors/css/extensions/offline/themes/offline-theme-slide.css')
                    link(rel='stylesheet', type='text/css', href='../app-assets/css/plugins/extensions/noui-slider.min.css')
                    link(rel='stylesheet', type='text/css', href='../app-assets/css/core/colors/palette-noui.css')

                  //- Vendor JS
                  append vendorjs
                    script(type='text/javascript', src='../app-assets/vendors/js/ui/jquery.sticky.js')
                    //- prism js
                    script(src='../app-assets/vendors/js/ui/prism.min.js', type='text/javascript')
                    //- Rating
                    script(src='../app-assets/vendors/js/extensions/jquery.raty.js', type='text/javascript')
                    //- knob
                    script(src='../app-assets/vendors/js/extensions/jquery.knob.min.js', type='text/javascript')
                    //- No Ui Slider
                    script(src='../app-assets/vendors/js/extensions/wNumb.js', type='text/javascript')
                    script(src='../app-assets/vendors/js/extensions/nouislider.min.js', type='text/javascript')

                  //- Page JS
                  append pagejs
                    script(src='../app-assets/js/scripts/extensions/knob.js', type='text/javascript')
                    script(src='../app-assets/js/scripts/pages/content-sidebar.js', type='text/javascript')
                
                
Refer following links for detailed documentation, configuration options, methods and examples:
Type URL
Content Right Sticky Sidebar https://pixinvent.com/modern-admin-clean-bootstrap-4-dashboard-html-template/html/ltr/vertical-menu-template/layout-content-detached-right-sticky-sidebar.html