Drupal 7 - Newly added custom page--*.tpl refuses to render -


i working drupal 7 , need create alternate page tpl's can have pages full width page 1 right sidebar. have read documentation , scoured net , @ point totally stumped.

step 1: created new content type called test , made basic page. step 2: went template.php file , added following code pre_process page function:

if (isset($vars['node'])) {           $vars['theme_hook_suggestions'][] = 'page__'. $vars['node']->type;     } 

step 3: created new page named page--test.tpl.php step 4: in admin > configuration > cleared site cache

step 5: epic failure... newly created page not render , page.tpl.php still displaying. tried different browsers & cleared cache no avail. don't know did wrong procedure seems follow correct steps have studied.

a search here landed me @ custom page-xxxx.tpl.php doesnt works suggestion there implement same preprocess code have installed.

i found great information @ https://drupal.stackexchange.com/questions/36054/how-to-have-a-another-page-tpl-php-file-in-drupal-with-different-regions-and-blo enabled me solve issue.

the solution:

instead of naming custom page page--yourcustompagename.tpl.php use format this: page--node--23.tpl.php if unsure of node number of custom page navigate content section , hover mouse on edit option custom created basic page , drupal display node number you.

as mentioned in 1 comment need clear cache clicking clear cache button in configuration > performance > clear cache. should clear theme registry mentioned in comment above. helpful tool found clearing theme registry magic module can find @ https://www.drupal.org/project/magic after install module go appearance > (your active theme) settings > development enhancements , check box "rebuild theme registry on reload"


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -