Changing generated html of a module. (Search API) I need to change the generated html (twig) of the search API module ( https://www.drupal.org/project/search_api ). The Module generates a form having 2 divs with input tag in each of them. I need it to be a form with one div having an input tag and an anchor tag!



What the module generates (in short)

&lt;form&gt;
 &lt;div&gt;
  &lt;input&gt;
 &lt;/div&gt;
 &lt;div&gt;
  &lt;input "submit-btn"&gt;
 &lt;/div&gt; 
&lt;/form&gt;




What I want it to be

&lt;form&gt;
 &lt;div&gt;
  &lt;input&gt;
  &lt;a "submit-btn"&gt;&lt;img&gt;&lt;/a&gt;
 &lt;/div&gt; 
&lt;/form&gt;




So basically, I need to be able to change the submit button to an image so I can place by "position:absolute" at the end of the first input field.

The search API module doesn't have the templates folder or any .twig files than I can overwrite. AND if I do overwrite the base theme form twig files that are used by the module, I cannot do it so that it changes only for this module and it doesn't change all other forms.

I am using drupal 8 btw.
I finally got around to do this using the MYTHEME.THEME file, I used this function:

function nestle_theme_suggestions_input_alter(&amp;$suggestions, array $variables) {
  $element = $variables['element'];
  if ($element['#id'] == 'edit-submit-search-content') {
    $suggestions[] = 'input__' . $element['#type'] . '__' . 'mainsearch';
  }
}  




Basically, it gets the element by its ID then changes its twig suggestion to kinda force twig to ditch the normal method of choosing the twig template based on naming conventions, Instead, it gives it a twig template to use!