Linked Questions

1 vote
4 answers
9k views

How to access webform elements in webform.html.twig

I'm trying to figure out a way to access webform elements from webform.html.twig. I need to style the form; wrapping some elements and adding bunch of styles all I have in the webform.html.twig is "...
Ibrahim Samir's user avatar
4 votes
2 answers
7k views

Override user login form template

I'm trying to customize my user login page in my custom theme using the template file page--user--login.html.twig, but am having issues accessing the different form elements. All aspects of the form ...
user avatar
4 votes
2 answers
4k views

How to render specific form elements from the *.theme file

I am using Drupal 8 and would like to customize how form elements are being displayed. Specifically, I don't like how uneditable, populated textfields are displayed as plain text. I would have it ...
user5013's user avatar
  • 1,497
5 votes
1 answer
13k views

How to Create twig template files in drupal 8 for customizing user login,profile edit and forget password forms?

Earlier we use the below code for creating custom template of user login ,user profile edit and forget password forms: function Yourtheme_theme($existing, $type, $theme, $path){ return array( '...
user avatar
2 votes
1 answer
867 views

How do I tell Twig not to print any form field?

I am trying to theme a form in Drupal 8. This is the template that I am using which is basically from form.html.twig <form{{ attributes }}> {{ element.app_theme_settings }} {{ element.a2 }} {{ ...
InspiredCoder's user avatar
1 vote
1 answer
78 views

Possible to theme the form's elements with own twig?

I was thinking to get twig outputs so I could use these twig variables on a form.html.twig such as below: <div class="row"> <div class="col-md-6"> {{ form.name }} ...
Truls S. Yggeseth's user avatar
0 votes
1 answer
724 views

submitForm() isn't called

Goal: Have a custom page that shows various elements including links, logos, images and a custom form to help the users reset their passwords (we have a custom reset password interface which sends the ...
dylhof's user avatar
  • 1
0 votes
1 answer
507 views

How can I access individual form elements for theming?

I have overridden the default user login form in Drupal 8 using a different template in my sub theme, but it isn't of much use because when I access it in twig template, all I can do is <form {{...
Aves2432's user avatar
  • 145
0 votes
0 answers
199 views

How to theme a paragraph form

I would like to create a twig template for the form displayed inside the paragraph widget. The only way I found is: function mymodule_field_widget_paragraphs_form_alter(&$element, &$form_state,...
Baud's user avatar
  • 542
0 votes
0 answers
102 views

Why is the region content already rendered as markup?

I'm attempting to craft some custom layout HTML in one region of my theme (uswds_base, but this doesn't appear to be theme specific). The content of a typical region.html.twig file is like the ...
JonMcL's user avatar
  • 617