eyurdakul
eyurdakul

Reputation: 912

drupal 7 custom template doesn't show up

i have a problem.

1 i've created a new page called Contacts, machine name is contacts 2 ensured, the path is correctly assigned (/contacts) 3 saved my page.tpl.php as page--contacts.tpl.php 4 even added some php code in my template php (see below)

function mytheme_preprocess_page(&$vars){
    //some syntax bla bla
    $alias = drupal_get_path_alias(current_path());
    $vars["theme_hook_suggestions"][] = "page--" . $alias;
}

and my custo template still doesn't show up!

Upvotes: 0

Views: 203

Answers (1)

eyurdakul
eyurdakul

Reputation: 912

hmm i believe you have to replace the dashes with underscores in your theme_preprocess_page hook;

function mytheme_preprocess_page(&$vars){
    //some syntax bla bla
    $alias = drupal_get_path_alias(current_path());
    $vars["theme_hook_suggestions"][] = "page__" . $alias;
}

Upvotes: 1

Related Questions