Skip to main content
1 of 3

Edit user profile template with module

How can I edit the user profile template in Drupal 7?

I've made a module called sporthron in my project.

sporthron.module contains :

/**
 * Implements hook_theme().
 */
function sporthron_theme($existing, $type, $theme, $path) {
  $theme = array();
  $theme['user_profile'] = array(
    'template' => 'user-profile',
    'path' => drupal_get_path('module', 'sporthron') . '/templates',
   );
  return $theme;
}

And here is the path to the template : /sites/all/modules/sporthron/templates/user-profile.tpl.php who contain :

<div class="profile"<?php print $attributes; ?>>
  <?php print render($user_profile); ?>
</div>

TEST

But this template is never used. Whatever edit I made is not applied.

And yes my module is enabled. Do you know how can I apply this template