We can easily create template files for the CCK content types by copying the contents of node.tpl.php and place it in the node-{content type name}.tpl.php. Update this file as you needed to this content type nodes.
Make sure you go to themes page and save (just save without making any changes, so drupal will rebuild the templates).
In some scenarios, node template is not enough. For example, we had a requirement to add an image banner before the page title for these cck nodes. First thing I checked is if Drupal supports page-{content type name}.tpl.php. Unfortunately, it doesn't support like in node. But it is very easy to add the functionality, so we can use page-{content type name}.tpl.php template. It is just a three step process:
- Open template.php, add the following code(Make sure rename {theme} with your actual theme name:
function {theme}_preprocess_page(&$vars) {
if ($vars['node']->type == 'product_list');
$vars['template_files'][] = 'page-'. $vars['node']->type;
} - Create a file called page-{template-name}.tpl.php in your theme folder, copy the contents from page.tpl.php to this file and make appropriate changes
- Go to themes page (/admin/build/themes/select) and save it just to allow drupal re-build the theme files
