Setting Different Page Design for a Content Type:
function phptemplate_preprocess_page(&$variables) {
if ($variables['node']->type == "right") {
$variables['template_files'][] = "page-node-" . $variables['node']->type;
}
}
If we want to create different page design for your content,then you need to create a content type and below that content you need to create the contents.Then if we need to create a tpl file for that content type.
For Example if you are creating a Content Type as "right",then you need to create a tpl like page-node-right.tpl.php.
After Creating the Content Type and tpl File,you should do this finally inside phptemplate_preprocess_page in your template file,
function phptemplate_preprocess_page(&$variables) {
if ($variables['node']->type == "right") {
$variables['template_files'][] = "page-node-" . $variables['node']->type;
}
}
No comments:
Post a Comment