Different page--user.html.twig for different user roles I have a few user roles - simple user, editor and contributor.

How to make different profile pages for all of this roles?

Now I can work with:

FILE NAME SUGGESTIONS:
   * page--user--16.html.twig
   * page--user--%.html.twig
   x page--user.html.twig
   * page.html.twig


But I want work with page--user--somerole.html.twig (not (!) user--page--somerole.html.twig)

Thank you for any help.
It's not much different from how it got solved in the other question you asked. You just have to target page this time. So hook_theme_suggestions_HOOK_alter() becomes hook_theme_suggestions_page_alter().

And you need to check if you are currently on a user page before you add the suggestion.

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function MYTHEME_theme_suggestions_page_alter(array &amp;$suggestions, array $variables) {

  $route_match = \Drupal::routeMatch();

  // Check if on user page.
  if ($route_match-&gt;getRouteName() == 'entity.user.canonical') {

    // Get current user
    $current_user = $route_match-&gt;getParameter('user');
    if ($current_user instanceof \Drupal\user\entity\User) {

      // Get user roles.
      $roles = $current_user-&gt;getRoles();
      foreach ($roles as $role) {

        // Add template suggestion per role.
        $suggestions[] = 'page__user__' . $role;
      }
    }
  }
}




Alternatively, if you want the suggestion to be added only for a certain role, try that:

/**
 * Implements hook_theme_suggestions_HOOK_alter().
 */
function MYTHEME_theme_suggestions_page_alter(array &amp;$suggestions, array $variables) {

  $route_match = \Drupal::routeMatch();

  // Check if on user page.
  if ($route_match-&gt;getRouteName() == 'entity.user.canonical') {

    // Get current user
    $current_user = $route_match-&gt;getParameter('user');
    if ($current_user instanceof \Drupal\user\entity\User) {

      // Add template suggestion for certain role.
      $role = 'somerole';
      if ($current_user-&gt;hasRole($role)) {
        $suggestions[] = 'page__user__' . $role;
      }
    }
  }
}