How do I print the help text description above the field for all textareas? For all textareas, I want to print the help text description above the field input.

By default, it looks like this:


Field Label
Field Input
Help Description


I want to arrange it like this:


Field Label
Help Description
Field Input


This was actually a hidden configuration option added to Drupal 8.0  So, the basic idea is that I have to set '#description_display' =&gt; 'before' for every textarea.

To do that, I tried to use template_preprocess_textarea().

I added the following code to mytheme/mytheme.theme:

function MYTHEME_preprocess_textarea(&amp;$variables) {
  $variables['#description_display'] = 'before';
}


I checked to make sure this code is called with kint() but it doesn't change the positioning of the help descriptions on the forms.  I checked my theme (Bootstrap's) templates and they have logic for handling before and after.  So what is the right way to call this to adjust the position of the help text on all textareas?
The description_display property is still working if supported by your active theme and I understand it is. Adding this to your mytheme.theme should do the trick :

function MYTHEME_preprocess_form_element(&amp;$variables) {
  if ($variables['element']['#type'] == 'textarea') {
    $variables['description_display'] = 'before';
  }
}


Note that this might not work with formatted fields from the field API as the description field is in a parent template, see text-format-wrapper.html.twig. It would be a little more complicated to have this working for those fields.