Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7083115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:08:18+00:00 2026-05-28T07:08:18+00:00

[For Drupal 6] Let’s say I’ve created a content type called my_content_type. I can

  • 0

[For Drupal 6] Let’s say I’ve created a content type called “my_content_type”. I can override the default template for that entire content-type by creating “page-node-my_content_type.tpl.php”. But, what would be the best way to then further customize a single node of that content type (e.g., node 5555)?

I tried the following, but none worked:

  • page-node-5555.tpl.php
  • page-node-my_content_theme-5555.tpl.php
  • node-5555.tpl.php

None of these work. They all continue to use my original content-type template.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:08:19+00:00Added an answer on May 28, 2026 at 7:08 am

    Drupal’s page templates work on a suggestion system. Based on the current URL, an array of possible template files is created. It loops through the array (in reverse order) looking for template files that exists. The first one it finds, it will use.

    drupal’s theme system provides a hook for you to modify the template suggestions.. open up your template.php and find

    function phptemplate_preprocess_page(&$vars) {
    

    the $vars variable is what contains the suggestions, specifically $vars[‘template_files’]

    By default the only page suggestions that are available are

    • page.tpl.php
    • page-node.tpl.php
    • page-node-[node_id].tpl.php

    As far as im aware, page-node-[node_type].tpl.php does not work by default, so its likely you have already modified the preprocess_page template to added in this functionality.

    However if you want to add more specific templates you could do something like this…

    function phptemplate_preprocess_page(&$variables) {
      if ($variables['node']->type != "") {
        $variables['template_files'][] = "page-node-" . $variables['node']->type;
        $variables['template_files'][] = "page-node-" . $variables['node']->type . "-" . $variables['node']->nid;
      }
    }
    

    this will allow the following hierarchy of template suggestions

    • page.tpl.php
    • page-node.tpl.php
    • page-node-[node_id].tpl.php
    • page-node-[node_type].tpl.php
    • page-node-[node_type]-[node_id].tpl.php
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Drupal I have the page content type. I have created a vocublary and
I've an issue, which is about php syntax/mysql in drupal: Let's say that userA
Ok, let's say i'm a big newby on drupal, and that i want to
Totally new to Drupal so be gentle please! Let's say I have a number
I need to import a big databases into Drupal CCK nodes. Let's say I
I'm trying to achieve a sort of special sorting in Drupal. Let's say we've
What I did Let's say my module was called some_module. Without disabling from the
Drupal is very much a Do Everything CMS. There are modules that allow you
Drupal employs a custom session handler that changes the familiar...: $_SESSION['foo'] = 'bar'; echo
I want a Drupal Module who let to the Adminintrator to upload pdf files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.