In Drupal 6, if you had a content type with the system name "stock-photo", you could override it using:


How do you do this in Drupal 7?

2 Answers 2


You can add custom node.tpl.php for any kind of content type like


I would suggest you to use hook suggestion at template.php for this :

function MYTHEME_preprocess_page(&$variables, $hook) {  // Add theme suggestion for all content types
    if (isset($variables['node'])) {
        if ($variables['node']->type != '') {
            $variables['theme_hook_suggestions'][] = 'page__node__' . $variables['node']->type;

So that I can have node--wine.tpl.php for content type wine.

Note -- Don't forget to clear your cache after this :)

  • 1
    What's the purpose of the PHP hook suggestion function? Commented Oct 20, 2015 at 3:22

I think MYTHEME_preprocess_page() function doesn't need for it.

The node--[node-type].tpl.php is only enough for it.

  • That worked for me :)
    – Gladiator
    Commented Aug 11, 2014 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.