Update skinning with more flexible theme module

This commit is contained in:
Nabeel Shahzad
2018-03-11 18:00:42 -05:00
parent 03c15473b9
commit f05e37767f
50 changed files with 216 additions and 80 deletions

View File

@@ -73,6 +73,8 @@ return [
Toin0u\Geotools\GeotoolsServiceProvider::class,
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
Irazasyed\LaravelGAMP\LaravelGAMPServiceProvider::class,
Igaster\LaravelTheme\themeServiceProvider::class,
Nwidart\Modules\LaravelModulesServiceProvider::class,
/*
* Application Service Providers...
@@ -82,7 +84,6 @@ return [
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Nwidart\Modules\LaravelModulesServiceProvider::class,
],
'aliases' => [

68
config/themes.php Normal file
View File

@@ -0,0 +1,68 @@
<?php
return [
'themes_path' => resource_path('views/layouts'), // eg: base_path('resources/themes')
'asset_not_found' => 'LOG_ERROR',
'default' => 'default',
'cache' => true,
/*
|--------------------------------------------------------------------------
| Define available themes. Format:
|
| 'theme-name' => [
| 'extends' => 'theme-to-extend', // optional
| 'views-path' => 'path-to-views', // defaults to: resources/views/theme-name
| 'asset-path' => 'path-to-assets', // defaults to: public/theme-name
|
| // You can add your own custom keys
| // Use Theme::getSetting('key') & Theme::setSetting('key', 'value') to access them
| 'key' => 'value',
| ],
|
|--------------------------------------------------------------------------
*/
'themes' => [
'default' => [
'extends' => 'false'
],
// Add your themes here. These settings will override theme.json settings defined for each theme
/*
|---------------------------[ Example Structure ]--------------------------
|
| // Full theme Syntax:
|
| 'example1' => [
| 'extends' => null, // doesn't extend any theme
| 'views-path' => example, // = resources/views/example_theme
| 'asset-path' => example, // = public/example_theme
| ],
|
| // Use all Defaults:
|
| 'example2', // Assets =\public\example2, Views =\resources\views\example2
| // Note that if you use all default values, you can omit declaration completely.
| // i.e. defaults will be used when you call Theme::set('undefined-theme')
|
|
| // This theme shares the views with example2 but defines its own assets in \public\example3
|
| 'example3' => [
| 'views-path' => 'example',
| ],
|
| // This theme extends example1 and may override SOME views\assets in its own paths
|
| 'example4' => [
| 'extends' => 'example1',
| ],
|
|--------------------------------------------------------------------------
*/
],
];