Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Has anyone succeeded to override page.tpl.php with page-type.tpl.php?
I tryed to add this code to template.php:
function basic_preprocess_page(&$variables, $hook) {
// Page template suggestions based off of content types
if (isset($variables['node'])) {
$variables['theme_hook_suggestions'][] = 'page__type__'. $variables['node']->type;
$variables['theme_hook_suggestions'][] = "page__node__" . $variables['node']->nid;
}
}
And also tryed to add if-part only to function basic_preprocess_page(&$vars, $hook) { -which is already in template.php.
I have content type (machine name) cars and added page--cars.tpl.php
But no luck. Also tryed to flush caches.
Comments
Comment #1
SteveK CreditAttribution: SteveK commentedThanks. added this to 3.x branch.