class AuditField extends InputField {
static public $fieldname = 'audit';
static public $assets = array(
'css' => array(
'style.css',
)
);
but it doesn’t matter. i want to add own fields like a select box or checkboxes to my field. the values are not saved to blueprint. they will be processed by a page.update.hook.
Well, yes, I have seen that but that is not the problem, you are using the option property, but where is it defined? That’s why I was asking for the complete field.
The Brick class renders pure html in the end. So you need to add proper <option> tags to the select field.
$select->append('<option value="val1" seleced>text1</option>');
// or use the html helper
$select->append(html::tag('option', 'text1', [
'value' => 'val1',
'selected' => true,
]));
// or use the brick class
$option = new Brick('option');
$option->attr('value', 'val1');
$option->attr('selected', true);
$option->html('text1');
$select->append($option);
@Svnt This would have been a lot less time consuming to solve if you had just posted your code as I asked you to do instead of leaving it all to guesswork.
It is important what field you extend, because these fields inherit from each other. So knowing what fields you extend, we know what we can expect from a field definition.
Adding multiple fields to one field was a bad idea at all.
Now i use a separate custom field for all my inputs and group them together with the ‘Global Field Definitions’.