2017 © Pedro Peláez
 

silverstripe-module brand

Branding and basic site theming admin for silverstripe

image

adrexia/brand

Branding and basic site theming admin for silverstripe

  • Sunday, April 29, 2018
  • by adrexia
  • Repository
  • 1 Watchers
  • 7 Stars
  • 105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Silverstripe Brand module

A module to assist with a website's basic branding. Allows setting of brand colours and fonts from within a Silverstripe Admin., (*1)

Requirements

SilverStripe 4 or higher. See 3.0 branch for SilverStripe 3 support, (*2)

Installation

composer require adrexia/brand, (*3)

Setup

You can either just include the Favicons, and apply the colour schemes manually: <% include Adrexia/Brand/Favicons %>, (*4)

Or, include the brand template in the head of you page template to get both:
<% include Adrexia/Brand/Brand %>, (*5)

By default this includes the fonts, the font-colors, and the favicons. The Menu colours are left for you to implement, or disable based on your site's requirements. The Palette colours are for use on other page types, or for custom theming. For example, they can be used to add a restricted colourpalette to a page (with the help of the Color Palette module):, (*6)

$brand = Brand::get()->First();

if($brand) {
    $fields->insertAfter(
        ColorPaletteField::create(
            "Color", "Color", $brand->getFullPalette()
        ), "Intro"
    );
}

There is an extension 'BrandDataObjectExtension' included for this purpose which adds a brand colour, a contrast colour, and an image. To enable it, add this to your _config.yml file:, (*7)

Page:
  extensions:
   - Adrexia\Brand\BrandDataObjectExtension

The other variables provided can be called in a template with:
$Brand.Logo
$Brand.BodyBackgroundColour, (*8)

To get the hex value of a colour from a colourpalette in your template you can do something like this:, (*9)

<% if $Colour %>$Brand.getHex($Colour)<% else %>$Brand.getHex($Level(1).Colour)<% end_if %>

Subsite support

NOTE: Subsite support isn't yet complete for silverstripe 4, (*10)

This module can work with subsites with the addition of the SubsiteModelExtension from adrexia/subsite-modeladmins (specifically, the onBeforeWrite and augmentSQL functions). You can install this via composer require, or just take the bits you need:, (*11)

composer require adrexia/subsite-modeladmins, (*12)

Setup:

In your yml config:, (*13)

Adrexia\Brand\Brand:
  extensions:
   - SubsiteModelExtension
Adrexia\Brand\BrandAdmin
  extensions:
   - SubsiteMenuExtension

The brand extension is supplied by the subsite modeladmin module. The BrandAdmin extension is straight from the subsites module, and enables the menu item in the CMS menu., (*14)

Screenshots

, (*15)

, (*16)

, (*17)

The Versions

29/04 2018

3.0.x-dev

3.0.9999999.9999999-dev

Branding and basic site theming admin for silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe

19/12 2017
24/08 2017

dev-feature/silverstripe4

dev-feature/silverstripe4

Branding and basic site theming admin for silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe