Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jtarleton/63628ccdf4bc8cedc8d636cd14079a7d to your computer and use it in GitHub Desktop.
Save jtarleton/63628ccdf4bc8cedc8d636cd14079a7d to your computer and use it in GitHub Desktop.
mymodule_form_user_login_form_alter.php
/**
* Implements hook_form_FORM_ID_alter() for form--user-login-form.html.twig.
*/
function sfp_form_user_login_form_alter(&$form, $form_state) {
$config = \Drupal::config('system.site');
$site_login_blurb_display = $config->get('site_login_blurb_display');
$site_login_blurb = ($site_login_blurb_display) ? $config->get('site_login_blurb') : '';
$form['#prefix'] = sprintf('<div class="site_login_blurb">%s</div>', $site_login_blurb);
$form['#suffix'] = '';
if ($site_login_blurb_display) {
$form['#attached']['library'][] = 'sfp/sfp-libraries';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment