Setting a Twig to a specific Form Container

by Akira Midori   Last Updated September 11, 2019 10:07 AM

As the title says,

There is a specific Form Container that I would like to add a twig to that is on a page having its own twig. No theme hook name suggestion is provided when I inspect its element.

enter image description here

My purpose is to style the specific form to be a credit card form.

enter image description here

Tags : 8 theming

Answers 1

You could try to add your own template suggestion via hook_theme_suggestions_HOOK_alter, which would mean hook_theme_suggestions_container_alter. There you might target the container by id or some other attribute (id does not seem promising here).

The container.html.twig does only provide a wrapping div around other content. While you could add more html to this, you might have to think about if container.html.twig is the right place to start here.

Stefan Korn
Stefan Korn
September 11, 2019 10:03 AM

Related Questions

Updated March 26, 2015 10:02 AM

Updated March 29, 2015 12:02 PM

Updated March 29, 2015 15:02 PM

Updated April 05, 2015 16:03 PM

Updated April 09, 2015 22:03 PM