Staic layout is useful for those platform having less menu options and content sections where user required to scroll less.
Default this template has a static layout elements, so there is no any specific classes need to add to create this layout.
To create this layout just need to confirm .fixed-top
, .menu-fixed
and .footer-fixed
not applied to their respective element, in short do not use fixed layout classes.
This section contains HTML Markup to create static layout. No need to add any specific classes just do not use fixed layout classes. This layout has a navigation, content and left sidebar sections with common header & footer.
Modern has a ready to use starter kit, you can use this layout directly by using the starter kit pages from the modern-admin/starter-kit
folder.
<!DOCTYPE html>
<html lang="en">
<head></head>
<body data-menu="vertical-menu" class="vertical-layout vertical-menu content-left-sidebar menu-expanded">
<!-- fixed-top-->
<nav role="navigation" class="header-navbar navbar-expand-sm navbar navbar-with-menu navbar-dark navbar-shadow navbar-border">
...
</nav>
<!-- BEGIN Navigation-->
<div class="main-menu menu-dark 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 body-->
<div class="content-body">
...
</div>
<!-- content body-->
</div>
</div>
<!-- END Content-->
<!-- START FOOTER DARK-->
<footer class="footer footer-dark">
...
</footer>
<!-- START FOOTER DARK-->
</body>
</html>
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.
This table contains required PUG variables to generate static layout.
Block | Variable | Datatype | Value | Description |
---|---|---|---|---|
pageConfig |
navbarFixed |
boolean |
false |
pageConfig block has a navbarFixed variable, it contains navbar position specific setting in that you need to set false for fixed navbar. |
navbarConfig |
navbarPosition |
string |
'navbar-static-top' |
navbarConfig block has a navbarPosition variable, it contains navbar position type specific classes in that you need to set 'navbar-static-top' for static navbar. |
verticalMenuConfig |
menuType |
string |
'menu-static' |
verticalMenuConfig block has a menuType variable, it contains navigation type specific classes in that you need to set 'menu-static' for static vertical navigation. |
horizontalMenuConfig |
menuType |
string |
'navbar-static' |
verticalMenuConfig block has a menuType variable, it contains navigation type specific classes in that you need to set 'navbar-static' for static horizontal navigation. |
footerConfig |
footerType |
string |
'footer-static' |
footerConfig block has a footerType variable, it contains footer type specific classes in that you need to set 'footer-static' for static footer. |
To generate boxed layout page or template, you need to use following PUG code.
navbarFixed
variable value as false
in pageConfig
block, as our layout is not fixed.navbarPosition
variable value as 'navbar-static-top'
in navbarConfig
block for static navbar.menuType
variable value as 'menu-static'
in verticalMenuConfig
block for static navigation in vertical layout.menuType
variable value as 'navbar-static'
in horizontalMenuConfig
block for static navigation in vertical layout.footerType
variable value as 'footer-static'
in footerConfig
block for static footer.content
block has content section html file included include ../contents/layout-static.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 static layout-static.pug
, however you can use it on template level but it will generate whole template as a static.
block pageVars
- var pageTitle = "Static Layout"
- var pageSubTitle = "Static layout with navigation"
- var description = "The static layout page structure have fixed navbar, navigation and footer."
- var activeMenu = "layout-static"
extends template
append pageConfig
- var navbarFixed = false
append navbarConfig
- var navbarPosition = "navbar-static-top"
append verticalMenuConfig
- var menuType = 'menu-static'
append horizontalMenuConfig
- var horizontalMenuType = 'navbar-static'
append footerConfig
- var footerType = "footer-static"
append breadcrumbs
+breadcrumbs([{url:"index.html",name:"Home"},{url:"#",name:"Page Layouts"}, {name:"Static Layout"}])
//- Include page content in page block
append content
include ../contents/layout-static.html
//- Vendor CSS
//------------------------------
//- Add Vendor specific CSS
append vendorcss
//- Page CSS
//------------------------------
//- Add custom page specific CSS
append pagecss
//- Vendor JS
//------------------------------
//- Add vendor specific JS
append vendorjs
//- Page JS
//------------------------------
//- Add custom page specific JS
append pagejs