Configuration
To configuration Options in details:
Key | Possible Options | Details |
---|---|---|
mainLayoutType | vertical-menu,horizontal-menu,vertical-menu-boxicons | To switch vertical/horizontal/vertical-boxicons layout. By defaul this will work with vertical layout. |
theme | light (default) / dark / semi dark |
Set between light theme, dark theme & semi-dark theme.
(note: semi-dark not applicable for
horizontal-menu)
|
isContentSidebar | true/false(default) | There are two types of page layouts with content sidebar or without content sidebar. e.g: email App is with content sidebar page layouts) |
pageHeader | true/false(default) | This option is used to show breadcrumb. |
bodyCustomClass |
Using this variable, you can add your own custom class
to include <body> tag.
|
|
navbarBgColor | bg-white(default for vertical-menu),bg-primary(default horizontal-menu), bg-success,bg-danger,bg-info,bg-warning,bg-dark |
Change the color of the navbar using available
options.
note: navbar color only visible when you scroll
down the page atlease 20px.
|
navbarType | fixed,static,hidden |
Change how the navbar is displayed.
note: horizontal-menu doesn't support hidden.
|
isMenuCollapsed | true/false(default) |
Toggle display of sidebar collapse or expand.
note: horizontal-menu does not support this
options.
|
footerType | fixed,static,hidden | Change how the footer is displayed. |
templateTitle | 'Frest' | You can change template name using this option. Frest(default) |
isCustomizer | true(default)/false | You can add or remove theme customizer in template. |
isCardShadow | true(default)/false | You can simply add or remove card shadow in whole template. |
isScrollTop | true(default)/false | You can hide/show scroll to top button. |
defaultLanguage | en(default),pt,fr,de | To set your default language in template. |
direction | env('MIX_CONTENT_DIRECTION', 'ltr')(default), env('MIX_CONTENT_DIRECTION', 'rtl') | To switch ltr/rtl direction of the layout. By defaul this will work with LTR layout. |
frest-laravel-admin-template/resources/sass/core/variables/_components-variables.scss
Change for Page Level Configuration :
If you want to add Page level configuration for layout, you
need to to set array for page configuration in
app -> Http -> Controller -> {Controller file}
and send it to your view.
public function {functionName}(){
$pageConfigs = [
'theme' => 'dark',
'navbarColor' => 'bg-primary',
'navbarType' => 'static',
'footerType' => 'sticky',
'bodyClass' => 'testClass'
];
return view('/pages/testPage', [
'pageConfigs' => $pageConfigs
]);
}
Create New Page
How to add New Page:
-
Create New View with
blade.php
extenstion. - Create Controller for different methods related to page. (Optional. You can use default controller also.)
-
Set Path in
routes/web.php
file to serve the page on the browser. -
Add page link to
resources -> data -> menus-> vertical-menu.json, horizontal-menu.json and vertical-menu-boxicons
files to display menu item in sidebar/menu. -
Add page link to
public -> data -> template-list.json
file to display in navbar search option. -
Add page name to
resources -> lang -> en{all language folder} -> locale.php
file to display in multi language.
Steps to add a new page:
Step 1: Create a file with the extension
.blade.php
under the
resources -> views -> pages
directory. Let's
create a testPage for an example with filename
testPage.blade.php and placing the below code in that file.
@extends('layouts/contentLayoutMaster') // choose any one option {contentLayoutMaster/fullLayoutMaster}
@section('title', 'Content Layout') // change title accrodingly
@section('content')
//page content
@endsection
Step 2: To add new controller, use below command :
php artisan make:controller {ControllerName} {-r}
To add breadcrumbs:
$breadcrumbs = [
['link'=>"/",'name'=>"Home"],['link'=>"/",'name'=>"Page"], ['name'=>"Content Layout"]
];
return view('/pages/test-page', [
'breadcrumbs' => $breadcrumbs
]);
Step 3: After creating file and controller
you need to declare its route where it can be served on the
browser, suppose you want created page to be serve on the
route http://localhost:8080/testPage . To access this page
define its routes in the
resources -> web.php
file.
Route::get('/testPage', function () {
return view('pages/testPage');
});
Step 4:
After defining the route, add page link to sidebar at
resources -> data -> menus -> verticalMenu.json /
horizontalMenu.json /vertical-menu-boxicons
file.
Option 1: To add item in menu.
{"url":"/testPage", "name":"Test Page", "i18n":"Test Page", "icon":"feather icon-file-text"},
Option 2: To add item as a sub menu item.
{"url":"#", "name":"Main menu", "i18n":"Main Menu", "icon":"feather icon-file-text",
"submenu": [
{"url":"submenu1", "name":"Submenu 1", "i18n":"Submenu1", "icon":"feather icon-circle"},
{"url":"submenu2", "name":"Submenu 2", "i18n":"Submenu2", "icon":"feather icon-circle"}
]
},
Step 5:
For page searching options in navbar search box, add page
link in
public -> data -> template-list.json
file.
{"name":"Test Page", "url":"/testPage","icon":"feather icon-file-text"},
Step 6: Add page name to
resources -> lang -> en{all language folder} ->
locale.php
file to display in multi language.
"Dashboard"=> "Instrumententafel",
"Modern"=> "Modern",
After completing these above steps you need to run the
command npm run dev
or
npm run watch
command in the project directory.
After running this process you need to run the command
php artisan serve
. It will serve your app on
the localhost.
RTL
To create RTL layout. There are two way to do this.
First Way
Change MIX_CONTENT_DIRECTION
variable value
from ltr
to rtl
in
.env
file
Second way
Change configuration option from
config -> custom.php
file.
Update direction
value from
'direction' => env('MIX_CONTENT_DIRECTION', 'ltr'),
to
'direction' => env('MIX_CONTENT_DIRECTION', 'rtl'),