I have a module that contains multiple forms, each form in its own file. I need to modify the page title such that it is different from the browser title for several of these pages. The name of the module is member_login. This is what I have so far:
function member_login_preprocess_page(&$variables) {
if (\Drupal::routeMatch()->getRouteName() == 'member_login.login') {
$variables['content']['#title'] = t("The new HTML title.");
}
}
I add this function to the .module file. Do I need to call it, or does Drupal call it automatically for it to come into effect? Currently, I do not see it into effect.