[support] Change Node Display

Steve Edwards killshot91 at comcast.net
Mon Dec 10 04:58:51 UTC 2007


You can create separate template field for each type of node you create.  All you do is take the node.tpl.php file and rename it 
to node-nodetype.tpl.php.  So for instance, if you wanted to create a separate template for blog nodes, you would clone 
node.tpl.php and name it as node-blog.tpl.php.  If you want to get even more fancy, you can use PHP code in template.php to 
specify which template file to use in certain cases.

All of this is explained in Chapter 8 of the "Pro Drupal Development" book, which you can download for free at 
http://www.apress.com/book/downloadfile/3486.  What I just discussed is on page 119.

Steve

Tom Holmes Jr. wrote:
> Ok ... so now that I have a working, stable copy of Drupal 5.5 on Resin 
> 3.1.4, now I can start learning Drupal again.
> 
> Now .... if everyone has lost patience with me ... I have a Post 
> Installation question to ask .... maybe a couple ...
> And all you have to to is point me in the right direction, or ask me for 
> any more information that is needed.
> 
> So, I created a new content type with cck, the date field, image field, 
> and link field .... no problem whatsoever.
> For some reason I can't search for the Node, I get some SQL error 
> message .. but that's ok ... not a big problem.  
> I presume the one and only node I created is not indexed yet .... I'll 
> experiment with that ... besides I have a lot of data to import anyway.
> 
> I guess my question (finally) is:
> Are all content type nodes viewed with the same theme or php code, 
> because obviously different content types have different fields.
> I would like to change the way content in a node is displayed for 
> different content types, is this possible and can you point me to the 
> right place?
> 
> Thanks!
>                              Tom
> 


More information about the support mailing list