Created
April 21, 2023 14:04
-
-
Save jtarleton/63628ccdf4bc8cedc8d636cd14079a7d to your computer and use it in GitHub Desktop.
mymodule_form_user_login_form_alter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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