In my template I have this,

    .getInputHtml( 'fields[ethnicOrigin]', '') | raw

which returns me a <select> html element Is it possible to add specific class to this select and or data- attribute?

1 Answer 1


If you take a look at the FieldType documentation it looks as the you need to create a template for the input field in which you can specify the actual html for your field. The example in the documentation is for a textarea but in your case you can substitute this for a select.

Then once you've done that just override the getInputHtml method to render your new template.

  • Thank you for your answer, but I would like to get my custom field ethnicOrigin which options are comming from the database.
    – Alex
    Jun 17, 2015 at 15:57
  • I've updated the answer, that should be more useful to you. Jun 17, 2015 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.