Creating a Different layout for our Site:
1.At first we need to create a content type as "layout" and save it.
2.After creating the content type,keep this coding in the top of the template file,
3.Then create a tpl as,page-node-layout.tpl.php.
4.In that tpl you can able to create a diff structure for the different layout from the old
5.Then print the content that you want to display in that layout like this,
<?php print $content;?>
6.After creating the tpl,create the contents under the "layout" content type
7.Now you will get the different kind of layout from old layout.There your contents will display.
***Different layout in the sense,with header or footer or both or just a content page without header,footer,left & right side blocks.
1.At first we need to create a content type as "layout" and save it.
2.After creating the content type,keep this coding in the top of the template file,
function yourthemename_preprocess_page(&$variables) {
if ($variables['node']->type == "layout") {
$variables['template_files'][] = "page-node-" . $variables['node']->type;
}
}
if ($variables['node']->type == "layout") {
$variables['template_files'][] = "page-node-" . $variables['node']->type;
}
}
3.Then create a tpl as,page-node-layout.tpl.php.
4.In that tpl you can able to create a diff structure for the different layout from the old
5.Then print the content that you want to display in that layout like this,
<?php print $content;?>
6.After creating the tpl,create the contents under the "layout" content type
7.Now you will get the different kind of layout from old layout.There your contents will display.
***Different layout in the sense,with header or footer or both or just a content page without header,footer,left & right side blocks.
No comments:
Post a Comment