2 Columns

2 columns layout with navigation

The full width 2 columns layout with content & navigation section.

Description

2 Columns layout is the most common and popular layout, it has a navigation with content section. This layout use the common navbar and footer sections, however you can add customized header or footer on page level.

CSS Classes

This table contains all classes related to the 2 columns layout. This is a custom layout classes for 2 columns layout page requirements.

All these options can be set via following classes:

Classes Description
.2-columns You can create 2 columns layout by adding .2-columns class in <body> tag.

HTML Markup

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

Robust has a ready to use starter kit, you can use this layout directly by using the sk-2-columns.html

        
            <!DOCTYPE html>
              <html lang="en">
                <head></head>
                <body data-menu="vertical-menu" class="vertical-layout vertical-menu 2-columns menu-expanded">
                  
                  <!-- navbar-fixed-top-->
                  <nav role="navigation" class="header-navbar navbar navbar-with-menu navbar-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 robust-content container-fluid">
                  </div>
                  <!-- END Content-->


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

                </body>
              </html>
        
        

JADE Configuration

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

JADE Variables

This table contains required JADE variables to generate 2 columns layout.

Variable Value Description
contentLayout '2-columns' You need to set contentLayout variable value as '2-columns' in pageConfig block.
JADE Code

To generate 2 columns layout page or template, you need to use following JADE code.

Line no 19-20: pageConfig block has a template specific configuration variables, in that for 2 columns layout need to define variable - var contentLayout = '2-columns'

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

              
                  block pageVars
                    - var pageTitle    = "2 Columns"
                    - var pageSubTitle = "2 columns layout with navigation"
                    - var description  = "The full width 2 columns layout with content & navigation section."
                    - var activeMenu   = "2-columns-layout"

                  extends template

                  block pageConfig
                    - var contentLayout = '2-columns'

                  append breadcrumbs
                    include ../includes/mixins
                    +breadcrumbs([{url:"index.html",name:"Home"},{url:"#",name:"Starters"}, {name:"2 Columns"}])

                  append page-header
                    include page-headers/breadcrumb-top

                  //- Include page content in page block
                  append content
                    include ../contents/2-columns-layout.html

                  //- Page specific dependency
                  //------------------------------

                  //- Add custom page specific CSS
                  block pagecss
                    link(rel='stylesheet', type='text/css', href='robust-assets/css/plugins/ui/prism.min.css')

                  //- Add custom page specific JS
                  block pagejs
                    script(src='robust-assets/js/plugins/ui/prism.min.js', type='text/javascript')
              
              

Please note that Robust Admin Template default layout is 2 columns.If you do not define pageConfig block on page or template level, it will consider 2 columns by default.