Hi, I want to make a custom node template file, but can't figure out what it should be named so that drupal recognizes it before the standard node.tpl.php

The following two names structures (which work with for page.tpl.php) do not seem to be working:

node-173.tpl.php
node-pagename.tpl.php

Thanks.

Comments

anthonylicari’s picture

node.tpl.php

This can be modified only by different content types, since it's the print $content variable in page.tpl.php that node.tpl.php is affecting. So your options are only content types...

node-forum.tpl.php
node-blog.tpl.php
node-video.tpl.php

Or whatever content types you have.

The variables available for you within node.tpl.php are...

$content
$date
$links
$name
$node
$node_url
$page
$taxonomy
$teaser
$terms
$title
$submitted
$picture

Hope this helps :)

www.skylabservices.com

mtpultz’s picture

I have a document content type and custom node-document.tpl.php (document name, description and attachment). I'd like to be able to create a page that lists specific ones... so in this site there are three pages that contain lists of documents and I'd like to be able to choose which document types are listed in a page for users to look at and download. Sort of like a blog does... create a blog and add blog types to it so you could have three blogs on your site if you wanted and have different blog types listed in each.

I'm comfortable with Drupal, using the latest version and I'm able to do PHP (incase this requires a module, hopefully not as I'm on a bit of a tight time budget).

Thanks

WorldFallz’s picture

Core taxonomy or the http://drupal.org/project/views module.

yelloroadie’s picture

Method is described at http://drupal.org/node/136647 for Drupal 5, my comment describes how to do it in Drupal 6.