Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MYMODULE_preprocess_user_profile(&$vars){
- // dsm($vars); // prints nice debugging information
- $vars['user_profile']['charity_link'] = array(
- '#markup' => l('Add Charity!', 'my/custom/link' . arg(1)),
- '#weight' => 10
- );
- }
- <?php
- // unset the original template to set yours.
- // Implement hook_theme_registry_alter
- function MODULENAME_theme_registry_alter(&$theme_registry) {
- $theme_registry['TEMPLATE_TO_OVERRIDE']['template'] = drupal_get_path('module', 'MODULENAME') . '/TEMPLATE_TO_OVERRIDE';
- $theme_registry['TEMPLATE_TO_OVERRIDE']['theme path'] = drupal_get_path('module', 'MODULENAME');
- }
- $theme_registry['user_profile'] = array(
- 'variables' => array(
- 'account' => NULL,
- ),
- 'template' => 'modules/user/user-profile',
- 'file' => 'modules/user/user.pages.inc',
- 'type' => 'module',
- 'theme path' => 'modules/user',
- 'preprocess functions' => array(
- 0 => 'template_preprocess',
- 1 => 'template_preprocess_user_profile',
- ),
- );
- <?php
- // unset the original template to set yours.
- // Implement hook_theme_registry_alter
- function MODULENAME_theme_registry_alter(&$theme_registry) {
- $theme_registry['TEMPLATE_TO_OVERRIDE']['theme_path'] =>
- drupal_get_path('module', 'MODULENAME'))
- }
- ?>
- <?php
- // Implement hook_theme_registry_alter
- function MODULENAME_theme_registry_alter(&$theme_registry) {
- $theme_registry['TEMPLATE_TO_OVERRIDE']['theme path'] =
- drupal_get_path('module', 'MODULENAME');
- }
- ?>
- /**
- * Implements hook_registry_alter().
- */
- function lml_node_theme_registry_alter(&$theme_registry) {
- $module_path = drupal_get_path('module', 'my_module');
- // Override the default template with our own.
- if (isset($theme_registry['toolbar'])) {
- $theme_registry['toolbar']['theme path'] = $module_path;
- $theme_registry['toolbar']['path'] = $module_path . '/templates';
- $theme_registry['toolbar']['template'] = 'mytemplate';
- }
- }
Add Comment
Please, Sign In to add comment