Hi there. I'm trying to add a colour picker to a site I'm working on. However it only saves in in Hexidecimal. However I want to use RGBA in my styling. So i'm trying to convert the Hex number to RGB.
I've set up a a custom control in a Page Type:
<?php
/**
* Defines the ArticleHolder page type
*/
class ArticleHolder extends Page {
static $icon = "themes/default/images/icons/article";
static $db = array();
static $has_one = array();
static $allowed_children = array('ArticlePage');
}
class ArticleHolder_Controller extends Page_Controller {
public function HexToRGB($hex = null)
{
return "Test";
}
}
And then in my "ArticleHolder.ss" template I'm using:
...
<% control HexToRGB($BarColour) %>
<p>RGB = $Value</p>
$Debug
<% end_control %>
...
However, I'm not getting anything through. What am I doing wrong? The desired result (for now) is for it to say:
<p>RGB = Test</p>
But nothing is being displayed.
I am trying to do this on a Child List page. Not sure that makes a difference?
Can anyone help me?
Cheers,
Steve