Skip to main content
3 of 3
edited tags
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Edit user profile template with module

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

I've created 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 which contains :

<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