hook_theme() to twig template of eform I have an eform printing out some fields. I want to create a module to change layout of the eform using hook_theme(). So, I have hook_theme() in my mymodule.module file and mymodule-form.html.twig file in template folder. Since I'm testing it, I only want to print out one field. But it prints out all of the field which seems like hook_theme() or twig is not working. Here's my code.

mymodule.module

&lt;?php

/**
  * Implements hook_theme()
  */
function gq_theme($existing, $type, $theme, $path) {
 return array(
    'gq_form' =&gt; array(
      'variables' =&gt; array(
        'first_name_field' =&gt; $form['field_first_name'],
      ),
    ),
  );
}

/**
 * Prepares variables for the gq form template.
 *
 * Default template: gq-form.html.twig.
 */
function template_preprocess_gq_form(&amp;$variables) {
  $variables['first_name_field'] = $form['field_first_name'];
}


mymodule.html.twig

{{ first_name_field }}


Also, I only have two files, mymodule.module, mymodule.info,yml, templates/mymodule-form.html.twig in module directory. Are there some necessary files?
Assuming that your template file is in a subfolder of your module folder (it looks like it's in templates), then your hook_theme needs to define the path. So it should look some thing like:

function gq_theme($existing, $type, $theme, $path) {
  return array(
    'gq_form' =&gt; array(
      'path' =&gt; $module_path . '/templates',
      'variables' =&gt; array(
        'first_name_field' =&gt; $form['field_first_name'],
      ),
    ),
  );
}


where $module_path is the path to your module.