0

I need to create a corporate business website under Drupal 7, and on each page (home, about, sevices, contact, etc.) the design is really different.

What would be the best way to structure/build this in Drupal? I'm used to Wordpress theme per page, but this does not look like it's built in Drupal.

Like thi theme: http://demo.drupalizing.com/?theme=corporateclean http://drupal.org/project/corporateclean

The design change quite a bit for each page. But when I download the theme, I don't see how they did that, since there's only that general page...

2 Answers 2

1

You can create a new theme using one of the many starter themes, and then override templates to get as specific as you please.

For example, to override a particular content type's look, you'd edit node--contenttype.tpl.php where contenttype is your custome content type.

The template guide contains further info, including naming conventions to get your templates applied in the right place.

1
  • Thats a very informative finding.
    – niksmac
    Nov 4, 2012 at 10:06
1

In such case what I do is: I write the following code in my template.php of the theme

function themename_preprocess_page(&$vars) {

     if (isset($vars['node']->type)) {

     $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;

 }
    }

Then I create a page.tpl.php for each content-type. For example if it is for content-type hotnews, then I create a page--hotnews.tpl.php file in my templates folder. In page--hotnews.tpl.php I write the things that I want to appear in my hotnews page.

For the front page, I create page--front.tpl.php. And I write the things like menu, header and footer that are common in all pages, in html.tpl.php.

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.