I am new in Drupal 8. I want to create a new theme to according to my HTML. What is the best practice to integrating a custom build theme to drupal engine.
I have covered all sections in Drupal 8 theming tutorial. Now I need to integrate custom login page.
I have added the following hook inside mytheme.theme file
function wms_aupl_theme(&$existing, $type, $theme, $path) { $hooks = array(); $hooks['user_login_form'] = array( 'render element' => 'form', 'template' => 'user-login-form', ); return $hooks; }
And Inserted my HTML in user-login-form.html.twig file as follows.
<div class="col-xs-12"> <div class="reg-form-2-wrap"> <form{{ attributes.addClass('user-login') }}> <div class="row"> <div class="col-xs-12"> <h1 class="main-head">Auktionsplattform</h1> </div> </div> <div class="row"> <div class="col-xs-12"> <label class="gen-reg-label-small">Some dummy content</label> </div> </div> {{ form.name['#title'] }} <div class="row mrgn-top-30"> <div class="row mrgn-top-30"> <div class="col-xs-3"> <label class="gen-reg-label"> </label> </div> <div class="col-xs-9"> {{ form.name. }} </div> </div> </div> <div class="row"> {{ form.pass }} <label class="gen-reg-label-pass"><a href="{{ base_url }}/user/password" class="reg-terms-anch">Passwort vergessen</a></label> </div> {{ form.form_build_id }} {{ form.form_id }} <div class="row mrgn-top-30"> <div class="col-xs-12"> {{ form.actions }} </div> </div> <div class="row"> <div class="col-xs-12"> <label class="gen-reg-label-small">Noch kein Konto? <a href="{{ base_url }}/user/register" class="reg-terms-anch">Hier registrieren</a></label> </div> </div> </form> </div> </div>
Now i need to specify inner element’s template. How can I specify inner elements template?
Is there any better way to do this?