cluesshop.com

Monday, 19 May 2014

drupal 7 theme hoocks

Template hoocks

template.php

function claimjockey_subtheme_preprocess_page(&$vars) {
  
// custom content type page template
  // Renders a new page template to the list of templates used if it exists
  if (isset($vars['node']->type)) {
// This code looks for any page--custom_content_type.tpl.php page
    $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
  }
     
if ($vars['is_front']) {
    $vars['title'] = '';
  }
 
//  var_dump(current_path());
//  exit();
   switch (current_path()) {
      case 'user':
        $vars['title'] = t('Customer Login');
       
//        var_dump($vars['contextual_links']);
//        exit();
       
        unset($vars['tabs']);
        break;
      case 'user/password':
        $vars['title'] = t('Forgot your password?');
        unset($vars['tabs']);
        break;

      case 'node/63':
          $vars['title'] = '';
        break;
     
  } 

}

No comments:

Post a Comment