Introduction to themes
Review existing themes
write code that will switch a theme
you will need a menu item definition

working with understanding drupal themes

Search for: working with understanding drupal themes

See if this link will help

Where is this specified?

More theming resources

drupal blank empty theme

Search for: drupal blank empty theme

I need a blank template theme. See answer

drupal theme hooks

Search for: drupal theme hooks

docs on hook_theme() in 7

All hooks in 7

custom theme hook docs

drupal 7 how to log messages from php?

Search for: drupal 7 how to log messages from php?

This doesn't seem to be too easy. couple of suggestion

drupal how to use watchdog

Search for: drupal how to use watchdog


function satya_test_cb1()
{
  watchdog('satya error title', 'satya error message');	
  return t("hello world: Garland");
}

And then go to admin/reports/recent log messages to see the message.

drupal: what is a machine readable theme

Search for: drupal: what is a machine readable theme

drupal how do i know the current active theme name?

Search for: drupal how do i know the current active theme name?

this link may help to get the theme name

php string functions

Search for: php string functions

php and strings manual

drupal dpm watchdog

Search for: drupal dpm watchdog

Here is a promising link on learnign through zen theme


function satya_test_module_custom_theme() {

  $current_theme = variable_get('theme_default','none');
  watchdog("curtheeme",$current_theme);
  
  $path = $_GET['q'];
  $pos = strpos($path, 'satyatest'); 
  watchdog("position","p:" + $pos);
  if( $pos === 0) {
    watchdog("Switching to bartik", $path);
    return 'bartik';
  }
  else
  {
     return $current_theme;
  }
}

admin
appearance
enable theme

/themes/themename

defines name, description, and regions


; $Id: bartik.info,v 1.5 2010/11/07 00:27:20 dries Exp $

name = Bartik
description = A flexible, recolorable theme with many regions.
package = Core
version = VERSION
core = 7.x

stylesheets[all][] = css/layout.css
stylesheets[all][] = css/style.css
stylesheets[all][] = css/colors.css
stylesheets[print][] = css/print.css

regions[header] = Header
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom
regions[highlighted] = Highlighted

regions[featured] = Featured
regions[content] = Content
regions[sidebar_first] = Sidebar first
regions[sidebar_second] = Sidebar second

regions[triptych_first] = Triptych first
regions[triptych_middle] = Triptych middle
regions[triptych_last] = Triptych last

regions[footer_firstcolumn] = Footer first column
regions[footer_secondcolumn] = Footer second column
regions[footer_thirdcolumn] = Footer third column
regions[footer_fourthcolumn] = Footer fourth column
regions[footer] = Footer

settings[shortcut_module_link] = 0


; Information added by drupal.org packaging script on 2011-01-05
version = "7.0"
project = "drupal"
datestamp = "1294208756"


; Information added by Acquia.com packaging script
acquia = "1"

Among other things this theme defines like many other themes various regions.


page.tpl.php
node.tpl.php
block.tpl.php
comment.tpl.php

These may come from different modules. Refer to the links above if you want to see their default representations.

what is the template.php in drupal?

Search for: what is the template.php in drupal?


drupal/themes
druapl/sites/all/themes
drupal/profiles/profile1/themes

rupal/themes/theme1/templates
druapl/sites/all/themes/theme1/templates
drupal/profiles/profile1/themes/theme1/templates

regions are defined in the .info file by their names

page.tpl.php will lay them out.

The only reason they are needed in the .info file is so that they can be used by the admin to place blocks via UI by the user.

Click on this link to sample page.tpl.php for bartik theme composing regions

Here is a good overview of theme files

This link is from the drupal theme guide. Gives you diagrams of how .info files and other constructs are related. should be a first read.

If you were to override html.tpl.php, vola you may have overriden everything. You can use this property to potentially create empty themes for ajax and such.

go to structure/blocks. Then you will see a link on the right that says "Demonstrate Block Regions".

From this you can get a sense of what the regions are and how they are laid out.


/devel/cache/clear

Ofcourse you have to have the devel module installed


$conf['theme_default'] = 'garland';

Read this Crash course on Firebug

everything is offset by a few pixels. To make this go away do


body
{
  margin:0;
}

margin differences between a body tag and a div tag

Search for: margin differences between a body tag and a div tag

odd

for a body margin seem to refer to what is inside. For a div it seem to refer to outside of the div.

when I set a margin for a div, it is saying leave this much space between my PARENT and me.

For a body this seem to be leave this much space between me and my CHILDREN

umm???


#header
{
	background:lavender;
	border: medium lavender solid;
}

with out the border spec it is leaving a white space at the top of the div. Not sure why!!

In the publish option of creating a document (or content) you can indicate more than one node sent to the home page. In this case you will see them listed one under the other.

Usually you may not want that. In that case locate the nodes and ensure just one is on the home page.

ofcourse you may find a pattern where this is quite reasonable to do and if you find the need you know likely what you are doing anyway