0

I couldn't find anywhere on the admin UI where I can change the input filter for term's description field. I have tried using hook_form_alter, but wasn't successful.

function mymod_form_alter(&$form, &$form_state, $form_id) {
  if($form_id === 'taxonomy_form_term') {
    $form['description']['#format'] = 'full_html';
    $form['description']['#title'] = t('test');
  }
}

The title for the input field would change, but not the format, even though dpm result indicates that the correct key/value pair was used. Is it too late in the rendering process to change the format of the field?

3
  • 1
    Have you tried attaching an #after_build handler to the form? Sometimes you need an after build to change certain elements on a form. Aug 13, 2014 at 20:13
  • @tyler.frankenstein, I tried attaching #after_build to the $form, and set the format of the description field on the function callback of #after_build. It is still not working though. I could manually change the input filter to other formats but I wish to set the default on page load.
    – rwaery
    Aug 13, 2014 at 20:43
  • 1
    @tyler.frankenstein, I ended up using javascript, which was added to $form['#attached'] to set the default selection after the page load.
    – rwaery
    Aug 13, 2014 at 20:56

0

Your Answer

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

Browse other questions tagged or ask your own question.