Is this possible somehow?
public static $db = array(
'Filter' => 'Varchar'
);
function getCustomFields(){
$filter = new OptionsetField(
$name = "Filter",
$title = "Filter",
$source = array(
"Greyscale,0,0,255" => "Greyscale",
"Sepia" => "Sepia",
"Colorize" => "Colorize"
),
$value = ""
);
$fields = new FieldList();
$fields->push($filter);
return $fields;
}
And use the Variable as a function in a template
<img src="<% if $Filter %>$CroppedImage(975,200).$Filter().URL<% else %>$CroppedImage(975,200).URL<% end_if %>" >
thanks.timo