Development

Using hook_form_alter() and #after_build to set maxlength on emvideo title field

A fellow Drupal user posted an issue to the Embedded Media Field project. The user was trying to set the maxlength from 35 characters to some other number for the ‘title’ field within each embedded video widget. I faced the same issue with a site. The client wanted to be able to add more lengthy captions to each video they uploaded. I added the embedded video field (YouTube) as an “unlimited” video field.

The solution involves using hook_form_alter() and the #after_build property.

 

Leave a Reply

Your email address will not be published.