I try to extend the NumericField class to create my own fields in a model admin. Here is the code I use :
class EuroField extends NumericField
{
public function __construct($name, $title = null, $value = '', $maxLength = null, $form = null) {
parent::__construct($name, $title, $value);
$this->setFieldHolderTemplate("EuroField_holder");
}
/**
* {@inheritdoc}
*/
public function Type() {
return 'euro text';
}
}
And now the template file : /themes/mytheme/templates/Includes/EuroField_holder.ss :
<div id="$HolderID" class="field<% if $extraClass %> $extraClass<% end_if %>">
<% if $Title %><label class="left" for="$ID">$Title</label><% end_if %>
<div class="middleColumn">
$Field <span>THIS IS A TEST</span>
</div>
<% if $RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %>
<% if $Message %><span class="message $MessageType">$Message</span><% end_if %>
<% if $Description %><span class="description">$Description</span><% end_if %>
</div>
Do you know why the template is not used?