How to create template files of a content type or as url parameters or default template

Add Following function if not present in your template.php file in theme folder
function phptemplate_preprocess_page(&$vars, $hook)
{
$url= drupal_get_path_alias($_GET['q']);
//print_r($url);
if($url == "as your type get from url")
{
$vars['template_files'][] = "page-yourgivenname";
}
else if ($vars['node']->type != "")
{
$vars['template_files'][] = "page-node-" . $vars['node']->type;
}
else
{
$vars['template_files'][] = "page";
}
}

No comments:

Post a Comment