Skip to content

helpfulrobot/otago-opcolor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#OPColorField

Creates a colour palette dropdown.

##Colour selector

OP colour in the CMS

Create your accepted colours and names in the settings tab in the CMS

OP colour in the settings

use the drop down to select your colour

##Usage

	public static $db = array(
		'ClassOverride' => 'Text'
	);

	function getCMSFields() {
		$fields = parent::getCMSFields();
		// create the op color field
        $colordropdown = OpColorField::create('ClassOverride', 'Color Override', $this->ClassOverride);
        $colordropdown->setEmptyString('');
        $fields->addFieldToTab("Root.Main", $colordropdown, "Content");
        
		return $fields;
	}

##What it does

It stores the CSSColor in the specified text field. Note the RGB color is the value that colors the box in the dropdown field. Other values, such as the CSSHex and CSSCMYK are optional.

About

Colour palette field for SilverStripe

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 47.0%
  • JavaScript 38.4%
  • CSS 9.7%
  • Scheme 4.9%