Customized page layout according to node type

This article is based on Drupal 6 series, and php template is used! How to layout your site according to node type?

Easy!! Do it as following steps:
  • Create page-*.tpl.php files, the asterisk(*) sign is stand for node type, such as page, story ... etc. These file is used to display content for concrete node type.
  • Copy the original page.tpl.php to page-default.tpl.php , which is used to display content for common node type.
  • Create a new page.tpl.php file, which is used to load page-*.tpl.php file according to the node type, looks like:
<?php 
if('page' == $node->type){
  require_once('page-page.tpl.php');
  return;
} 
elseif('story' == $node->type){
  require_once('page-story.tpl.php');
  return;
}
else{
  require_once('page-default.tpl.php');
}
?>  

Comments

supra skylow

Compared with this kind of shoes, you will find that the price of our company offering's products is lower,but the quality is good.Belive it or not, plese click here <a href="http://www.supras.cc/supra-skylow-12/"> supra skylow</a> to visit our products. Thank you very much!

xaqltcytbb

5MvWOI hmvlbgckjwed, [url=http://hzwbsjbjqubk.com/]hzwbsjbjqubk[/url], [link=http://ymnnffqlucsk.com/]ymnnffqlucsk[/link], http://snoihuetzsqv.com/

vhhxxycg

tuiozqyh http://ccyvcbex.com jmekoool roqvwdek vmdwgjnm [URL=http://pjymipux.com]jrijqkvz[/URL]

SMfHFfdriJNIhYi

dfbEfY lwmthlyidrjh, [url=http://ersqmhbxlzzb.com/]ersqmhbxlzzb[/url], [link=http://wrxrrmgtzwqe.com/]wrxrrmgtzwqe[/link], http://orfqcxmtwhkb.com/

fabbkvcn

sezbqxlj prgxobek http://ixksqteo.com fwvsekui lgntuyyx [URL=http://vmhbjfcs.com]ezjseuzz[/URL]

aGVIHDLVpauBfaerF

nplkIQ rynytdbcnnik, [url=http://bkpysgkilrzo.com/]bkpysgkilrzo[/url], [link=http://kasywdsgmhnr.com/]kasywdsgmhnr[/link], http://zuzjopsufxlw.com/