Theming A Drupal Blog

In today's podcast, Bob dives into the world of Drupal theming by showing how to create a node-custom.tpl.php file and how to use print_r($node). The alternative to this is to do all the same stuff but use contemplate.module. Hopefully it makes sense...Bob recorded this one pre-coffee.

Another helpful cast. The print_r node code is great. Going to jot that one down. Made me excited to get into this and at the same time made me realize all this php stuff is over my head. Im sure it will eventually become clear.
Bob, An excellent explanation of how to theme a specific nodetype. Keep them coming! /keith
I have always had a hard time understanding this until I saw you work though it in the video. Great stuff!
Bob - Great videos! What editor are you using in this video podcast? Thanks! Keep rockin' out for the Kingdom [I appreciate what you do]. Blessings, .theWatts
People keep asking what editor this is, I may just have to do a screencast on it....It's my new favorite editor Coda. I just love it.
How can I make the title link back to the node?
" title="<?php print $title ?>"><?php print $title ?>
Rob, Thanks!!! For the sake of curiosity I seemed to miss how does it know to use your tpl file instead of the one one in the module? Thanks Kent
@kent When drupal loads a page it looks through template files in a certain order. Basically, the answer of "how it knows" is because it tries to load a tpl.php file in your theme folder before one in the core drupal installation. If it finds one there, it loads it...if not, it moves onto the core (default) files.
Bob you are awesome. Great stuff ! Keep floooding such great podcasts. :) Can we expect something about Panels in next upcoming podcasts ?
Hey Everyone, I've just seen the podcast, I found it very helpful, so thanks for that Bob, Just one problem. I seem to have run into the same problem that you had on the pod cast where Drupal doesn't recognise my newly created node-blog.tpl.php file. so its not having any effect on my website. I couldn't really understand how you solved the problem. so any additional advice you may have would be wonderful :-)
Hello, yesterday i found this videopodcast by a fluke and its realy great. But especialy for this tutorial i´ve got a similar problem like the guy before. I created a node-type called members and i wanted to theme the teaser of it, so i created a theme and saved it as "node-members-teaser.tpl.php" but it doesent work. When i theme it with contemplate, using the same code, there´s no problem. But i would need it as a .tpl.php-file. I am using Drupal 6.9, the theme was completly created by me. There´s just a theme.info, a page.tpl.php and the css-files. Could this be wrong? Do i need a template.php? And what content does the template.php need?
I haven't seen anywhere in the drupal documentation that you can create something like node-members-teaser.tpl.php (by which I mean the -teaser part). I could be wrong (this would be an AWESOME feature) but I haven't seen that. You'd need to create a node-members.tpl.php and use if statements such as: if($teaser).... or if($page)... I'd love it if someone corrected me and said you could do this with teasers...that would be great! Also, note that you must have a node.tpl.php file in order for a node-custom.tpl.php to work. I think they changed this in a later version of D6, but haven't confirmed that. If you don't have a node.tpl.php, make sure to add one before adding a custom version.
Didnt know that i would need a node.tpl.php-file ot add customized tpls. I´ll try it out. The idea with the node-meber-teaser came from the contemplate-module, which is telling me, if i want to create a file for a teaser-temmplate, i´ll have to do it this way (i am using the german verison). Thanks for your tip.
In fact it works as explained in the docs. You have to create a folder named contemplates inside your www/sites/default/ or www/sites/all/ (not inside your theme folder!) and, inside that directory, name the files like these: node-members-body.tpl.php and node-members-teaser.tpl.php Then you just copy/paste what you got from contemplates (from the Drupal admin system) into the new created files. You have to visit the contemplates page everytime you add or remove a template but not when you edit one. Last precision: on the contemplates page you don't need to create a template, so delete the one you created for testing.
I'm going to do a marathon tonight to catch up on your video pod casts. Someone from Advantagelabs.com in Mpls referred this site to me. It's really good stuff. You've got a talent for taking complicated ideas and stating them simply and in a short period of time. Thanks for your work and for contributing to the community in this way.
Answer found here: http://drupal.org/node/190815 The bit you're interested in.... scroll down to this: Template suggestions: Suggestions only work when it is placed in the same directory as the base template. In other words, trying to get comment-blog.tpl.php to work, comment.tpl.php also needs to exist inside your theme and in the same directory.
I'm trying hard since few days to have blog teaser with image on the left and the text next (inline, float:left) here is my sheet>>> for css: /* blog.module */ /*blog-teaser { border: 1px solid grey; padding: 2px; } blog-picture { float: left; /* LTR */ padding-left: 2px; } blog-content { padding-right: 10px; }*/ for contemplate: /* <?php print $node->field_blog_picture[0]['view'] ?> <?php print $node->content['body']['#value'] ?> */ I have try /* tr.blog-teaser { border: 1px solid grey; padding: 2px; } td.blog-picture { float: left; /* LTR */ padding-left: 2px; } td.blog-content { padding-right: 10px;*/ getting white hairs. Please, tell me what I have to change. THKS