Posted by ace11 on October 1, 2012 at 9:46am
2 followers
Jump to:
| Project: | Basic |
| Version: | 7.x-3.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | SteveK |
| Status: | closed (fixed) |
Issue Summary
Has anyone succeeded to override page.tpl.php with page-type.tpl.php?
I tryed to add this code to template.php:
<?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
#1
Thanks. added this to 3.x branch.