- 🇳🇬Nigeria chike Nigeria
@Spanners most likely you have moved on from this but yesterday I had need of this and this code got me started as well then I made a tweak to accommodate what you were asking because I have same scenario. I made the code this way so I could set different titles for different registration pages,
function reg_alters_preprocess_page_title(&$variables) { $current_route = \Drupal::routeMatch()->getRouteName(); $current_path = \Drupal::service('path.current')->getPath(); if ($current_route == 'multiple_registration.role_registration_page' && $current_path == '/user/register/custom_role') { $variables['title'] = t('Register as Custom Role'); } if ($current_route == 'multiple_registration.role_registration_page' && $current_path == '/user/register/custom_role_2') { $variables['title'] = t('Register as Custom Role 2'); } }