hello,
I would like to understand how to create different areas into a Drupal theme, what I mean is that I would like to create something similar to http://adrenalinehub.com/ or http://digett.com/, or http://fabsugar.com/ where I have a different "style" for each area I visit (Home, My Home, Images, Videos, People, Content, Partner).

I would like to enable a theme where I go in different areas and I get different page.tpl.php styles..

I'm a little confused about explaining this but hope being enought clear :|

thanks

Comments

marcor’s picture

Tabs-Theming may be something different (I just searched for this)... What you look for is having different page-templates (page.tpl.php) for different sections of your site.

There is some good programming advice in the theme developers section.

Principle: In your theme's directory you can create a file template.php. All changes from the default behaviour (incl. overrides) are made here. There you place the choice which page-template to take.
Maybe you might find this node helpful: http://drupal.org/node/23348 Here it's shown how to make this choice from the page's url-path.

Maybe others will have better suggestions.

Greets,

Marco

effebi’s picture

theming based on phptemplate

enable page.tpl.php as 'index page'

<?php

 $uri_request_id = $_SERVER['REQUEST_URI'];
 $section = explode("/", $uri_request_id);
 switch ($section[1])
  {
    case 'layout1': include 'page-layout1.tpl.php'; break;
    case 'layout2': include 'page-layout2.tpl.php'; break;
    default: include 'page-default.tpl.php';
  }

?>

so that you can create one page-template.tpl.php for every layout

to enable different style sheets inserti this:

 <?php $styles .= theme('stylesheet_import', base_path() . path_to_theme() . '/style-layout1.css'); ?>
 <?php print $styles ?>

in page-layout1.tpl.php after print $head

hope being enough clear an helpful to someone else ;)

jaku ayala’s picture

This is exactly what I'm looking for. Thanks!
The css part doesnt seem to work though. Not a big deal, I just used the original css :P

brst t’s picture

There are two modules that could also be used to handle this. Taxonomy theme and Node style. The former would make more sense in this case, if the tabs arre associated with a taxonomy (categories and a vocabulary).

effebi’s picture

yeah, but sometimes i need to create pages and sub-pages without any type of categorization

(and i prefer working on HTML/CSS code! ;^)

brst t’s picture

Sure. Whatever works for you.

Just offering the suggestions to you and whomever else may read this thread.