Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I need to develop a page template based on the custom content type,because I don't want to use the page.tpl.php file template.

I have followed the below steps for creating Page Templates per Content Type. I am working drupal 7 bartik theme

My steps are:
1.I have added below code in the theme template file like
JavaScript
function bartik_preprocess_page(&$vars) {
   if (isset($vars['node']->type)) {
      $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
   }
}

2.I have created a content type named as lawngarden (Machine name: lawn)
3.I have created a page template (page--lawn.tpl.php) under themes templates folder
4.I have clear the cache
5.Enter the url in browser like http://localhost/appl/?q=lawn(clean url's disabled) & http://localhost/appl/lawn(clean url's enabled)
6.The page displays like requested page "/appl/?q=lawn" could not be found.

Please help me and provide me with suggestions. Thanks in advance.
Posted
Updated 15-Jun-12 9:00am
v2
Comments
Peter_in_2780 17-Jun-12 22:53pm    
You should ask this on the Drupal users forum. There you will find many more experts.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900