Skip to content

Commit

Permalink
Added CMS branding settings - closes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Oct 9, 2016
1 parent 4de38ca commit b3743bc
Show file tree
Hide file tree
Showing 8 changed files with 454 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A [SilverStripe](http://silverstripe.org) module to give the CMS a more modern,

## Features ##

* **NEW:** branding settings for app name, app link, logo and loading images
* site config panel with color picker fields
* resizable site tree
* Flat, modern, minimalist look and feel
Expand All @@ -24,7 +25,7 @@ A [SilverStripe](http://silverstripe.org) module to give the CMS a more modern,
#### Composer:

```
require: "praxisnetau/silverstripe-moderno-admin": "~1.0"
require: "praxisnetau/silverstripe-moderno-admin": "~1.1"
```

#### Manual:
Expand Down
15 changes: 15 additions & 0 deletions _config/moderno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ LeftAndMain:
extra_requirements_javascript:
- moderno-admin/javascript/moderno.js
extra_requirements_css:
- moderno-admin/css/cms/cms.css
- moderno-admin/css/moderno.min.css
- moderno-admin/css/moderno-editor.min.css
- moderno-admin/css/font-awesome.min.css
Expand All @@ -17,6 +18,20 @@ SiteConfigLeftAndMain:
extensions:
- SiteConfigEditFormExtension

ModernoConfigExtension:
resize_methods:
CropWidth: Crop Width
CropHeight: Crop Height
Fill: Fill
FillMax: Fill Max
Fit: Fit
FitMax: Fit Max
Pad: Pad
ScaleWidth: Scale Width
ScaleHeight: Scale Height
ScaleMaxWidth: Scale Max Width
ScaleMaxHeight: Scale Max Height

CMSPagesController:
awesome_icon: sitemap

Expand Down
28 changes: 28 additions & 0 deletions code/extensions/ModernoAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,35 @@ class ModernoAdminExtension extends LeftAndMainExtension
public function init()
{
if (class_exists("SiteConfig") && $SiteConfig = SiteConfig::current_site_config()) {

// Load Moderno Custom CSS:

Requirements::customCSS($SiteConfig->renderWith('ModernoAdminCustomCSS'));

// Customise Application Name:

if ($application_name = $SiteConfig->ModernoApplicationName) {

Config::inst()->update(
'LeftAndMain',
'application_name',
$application_name
);

}

// Customise Application Link:

if ($application_link = $SiteConfig->ModernoApplicationLink) {

Config::inst()->update(
'LeftAndMain',
'application_link',
$SiteConfig->dbObject('ModernoApplicationLink')->URL()
);

}

}
}
}
Loading

0 comments on commit b3743bc

Please sign in to comment.