16

I have one page in my D7 website with significant deviation from the rest of my pages. In this page I will only display a limited number of regions and in a different layout.

What is the best way to override the default page.tpl.php? Can I create something like "mycustom-page.tpl.php" that gets called ONLY on a specific url within my site?

1 Answer 1

13

Depending for what exact content you want to make a special template there are diffrent solutions for that. Look at Drupal 7 Template Suggestions. Example for a single node: page--node--1.tpl.php.

In case the core template suggestions do not offer the flexibility you need, you can add more suggestions based on your own criteria. This is done in a preprocess function in your theme's template.php. For more information, see Working with template suggestions.

3
  • absolutely perfect and amazingly simple. thumbs up to Drupal and the drupalites :) Jun 8, 2011 at 6:22
  • 1
    Good answer. I added some info about adding your own template suggestions, in case @Charlie or anyone else needs it. Jun 8, 2011 at 6:46
  • drupal.org/project/devel_themer will help you find the name too
    – rémy
    Dec 22, 2015 at 9:51

Your Answer

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

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