Symfony Folder Structure
- templates
-
partials
- body.html.twig / Contain the body tag code.
- footer.html.twig
- head-css.html.twig / added common css files link in this file.
- horizontal.html.twig
- main.html.twig / html tag with attributes is stored in this common file.
- menu.html.twig
- page-title.html.twig / Breadcrumb is defined in this file.
- right-sidebar.html.twig / Contain the right sidebar theme customization HTML code.
- sidebar.html.twig / Sidebar menu-related code is in this file.
- title-meta.html.twig / Page title and meta tags are defined in this file.
- topbar.html.twig / Topbar-related code is in this file.
- vendor-scripts.html.twig / Common js files are linked in this file.
Symfony file structure
We have used gulp to compile the html, scss and js files.
{{ include('partials/main.html.twig') }}
<head>
{{ include('partials/title-meta.html.twig', {title: 'Calendar'}) }}
{{ include('partials/head-css.html.twig') }}
</head>
{{ include('partials/body.html.twig') }}
<div id="layout-wrapper">
{{ include('partials/menu.html.twig') }}
<div class="main-content">
<div class="page-content">
<div class="container-fluid">
{{ include('partials/page-title.html.twig', {pagetitle: 'Apps', title: 'Calendar'}) }}
</div>
</div>
{{ include('partials.footer.html.twig') }}
</div>
</div>
{{ include('partials/right-sidebar.html.twig') }}
{{ include('partials/vendor-scripts.html.twig') }}
</body>
</html>
Layout setup
You can set the default layout in the templates/partials/_body.html.twig
file in the body tag.
<body data-topbar="dark" data-bs-theme="dark" data-sidebar-size="md">
data-layout-size="fluid" | To set fluid layout size. |
---|---|
data-layout-size="boxed" | To set boxed layout size. |
data-bs-theme="light" | To set Light layout mode. |
data-bs-theme="dark" | To set Dark layout mode. |
data-layout-scrollable="false" | To set layout position Fixed. |
data-layout-scrollable="true" | To set layout position Scrollable. |
data-topbar="light" | To set the Light color of Topbar. |
data-topbar="dark" | To set the dark color of Topbar. |
data-sidebar="light" | To set the Light color of sidebar. |
data-sidebar="dark" | To set the dark color of sidebar. |
data-sidebar="brand" | To set the brand color of sidebar. |
data-sidebar-size="md" | To set the Compact sidebar. |
data-sidebar-size="lg" | To set the Default sidebar. |
data-sidebar-size="sm" | To set the Small (Icon View) sidebar. |