First theme with Drupal

aliens.info

name = RBCM Aliens
description = Default theme

core = 6.x
engine = phptemplate

regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer

features[] = search

stylesheets[all][] = style.css
scripts[] = script.js

page.tpl.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=$language->language?>" lang="<?=$language->language?>" dir="<?=$language->dir?>">
 
<head>
  <title><?=$head_title?></title>
  <?=$head?>
  <?=$styles?>
  <?=$scripts?>
</head>
<body class="<?=$classes?>">
	<?=$content?>
 
	<?=$closure?>
</body>
</html>

Notes

If you add a new theme or preprocess function to your template.php file or add a new template (.tpl.php) file to your sub-theme, you will need to rebuild the “theme registry.” See http://drupal.org/node/173880#theme-registry

To set extra variables for *.tpl.php (use $vars)

  • function fusion_core_preprocess_node(&$vars)
  • function fusion_core_preprocess_page(&$vars)
  • node.tpl.php -> node-article.tpl.php
  • custom template for front page -> page-front.tpl.php
  • $is_front to test -> does that work with i18n??
  • custom template for specific node: page-node-2.tpl.php

navs

  • i18nmenu_translated_tree()
      if (module_exists('i18nmenu')) {
 
        $vars['primary_links_tree'] = i18nmenu_translated_tree(variable_get('menu_primary_links_source', 'primary-links'));
 
      }

Reference

Feedback