Detached Right Sticky Sidebar

Description

Content layout with detached right sticky sidebar provides more navigations options on page level. For the larger screen this layout provides best usability. This layout use the third column as a sticky sidebar section.

CSS Classes

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

All these options can be set via following classes:

Classes Description
.content-detached-right-sidebar You can create 3 column detached right layout by adding .content-detached-right-sidebar class in <body> tag.
.content-detached In this layout content section is detached from right sticky sidebar, for that .content-detached class needs to add in content wrapper. Refer HTML markup line no 27.
.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-detached In this layout right sticky sidebar section is detached from content, for that .sidebar-detached class needs to add in sidebar wrapper. Refer HTML markup line no 33.
.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 detached right sticky sidebar layout. You need to add the .content-detached-right-sidebar class in the <body> tag as show in below markup on line no 4. This layout has a navigation, content and right detached sidebar sections with common header & footer.

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

Stack has a ready to use starter kit, you can use this layout directly by using the starter kit pages from the stack-admin/starter-kit folder.

                        
            <!DOCTYPE html>
              <html lang="en">
                <head></head>
                <body data-menu="vertical-menu" class="vertical-layout vertical-menu content-detached-right-sidebar menu-expanded">
                  
                  <!-- fixed-top-->
                  <nav role="navigation" class="header-navbar navbar-expand-sm 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 app-content">
                      <div class="content-wrapper">
                          <!-- content header-->
                          <div class="content-header row">
                              ...
                          </div>
                          <!-- content header-->
                          
                          <!-- content detached right-->
                          <div class="content-detached content-left">
                              ...
                          </div>
                          <!-- content detached right-->
                          
                          <!-- sidebar detached right-->
                          <div class="sidebar-detached sidebar-right">
                              <div class="sidebar sidebar-sticky">
                                  ...
                              </div>
                          </div>
                          <!-- sidebar detached right-->
                          
                      </div>
                  </div>
                  <!-- END Content-->
                  <!-- START FOOTER DARK-->
                  <footer class="footer footer-dark">
                      ...
                  </footer>
                  <!-- START FOOTER DARK-->
                </body>
              </html>
        
        

JADE Configuration

Stack 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 3 column detached right sticky sidebar layout.

Block Variable Datatype Value Description
pageConfig contentLayout string 'content-detached-right-sidebar' pageConfig block has a page configuration variables, in that for 3 column layout need to define variable - var contentLayout = 'content-detached-right-sidebar'.
pageConfig sidebarSticky boolean true To make right sticky sidebar pageConfig block also require - var sidebarSticky = true configuration variables, set value as true to enable it.
JADE Code

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

  • Line no 20-22: You need to set contentLayout variable value as 'content-detached-right-sidebar' in pageConfig block.
  • Line no 22: You need to set sidebarSticky variable value as true in pageConfig block to enable right sticky sidebar.
  • Line no 28-29: content block has content section html file included include ../contents/layout-content-detached-right-sticky-sidebar.html, which can be customizable on page level.
  • Line no 31-32: 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 jade file for content detached right sticky sidebar content-detached-right-sticky-sidebar.jade, however you can use it on template level but it will generate whole template as a content detached right sticky sidebar.

                        
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace CodeByPradeep.Controllers
{
    public class CsharpController : Controller
    {
        public ActionResult Csharp()
        {
            return View();
        }
        protected override void HandleUnknownAction(string actionName)
        {
            try
            {
                this.View(actionName).ExecuteResult(this.ControllerContext);
            }
            catch (Exception)
            {
                this.View("Error").ExecuteResult(this.ControllerContext);
                
            }
        }
    }
}