- 9
- A
- A Block
- A Cold Day
- A Sync
- A cloudy day
- A3 Atlantis
- AD Blueprint
- AD Lemon Twist
- AD Novus
- AD Novus Fluid
- AD Redoable
- AD The Morning After
- ADT Basetheme
- AT Admin
- AT Koda
- AT Subtheme
- Aardvark
- Abac
- Abaca
- Abarre
- Aberdeen
- Aberdeen-liquid
- Abessive
- Ability
- About
- Aboutpeople
- Absolution
- Abstract
- Absynthe
- Abundant
- Acquia Marina
- Acquia Prosper
- Acquia Slate
- Acrylic
- Active NRebuild
- Activesite
- AdaptiveTheme
- Adaptivetheme Mobile
- Addari
- Aeon5
- Affaires
- Agregado
- Agua
- Airy Blue
- Alagna
- Alek 2.0
- Alina
- Alpha
- Amadou
- Amity Island
- Amor Azul
- Analytic
- Andreas 00
- Andreas
- Andreas00
- Andreas01
- Andreas02
- Andreas03
- Andreas04
- Andreas05
- Andreas06
- Andreas07
- Andreas08
- Andreas1024px
- Anita Kravitz
- Antique Modern
- Appleweb
- Aqua Fish
- Aquanaut
- Arclite
- Art School
- Arthemia
- Artists C01
- Artsy
- Aurora
- Aurora Australis
- Austere
- Austin
- Autumn Almanac
- aBeesParadise
- art4 green
- async
- awesome
- B
- B7
- Barlow
- Barron
- Barroness
- Basic
- Beach
- Beginning
- BeginningW2
- Berylizer
- Black Mamba
- Blackout
- BlogBuzz
- Blommor01
- Blossom
- Blue Bars
- Blue Citron
- Blue Lake
- Blue Nile
- Blue Zinfandel
- BlueTrip
- Bluefun
- Bluemarine
- Bluemarine ETS
- Blueprint
- Bluespan
- Bookstore
- Box_grey
- Burnt
- Burnt Rubber
- beMiracle Browny
- beat
- blix
- bluebreeze
- bluebreeze fixed
- box_cleanslate
- C
- Bisque
- Black
- Blue
- Brown
- CDMUG
- CTI Flex
- CWS
- Camaxtli
- Camsel
- Candy Corn
- Canvas
- Celju
- Chai Garam
- Chameleon
- Channel Nine
- Charity
- Chartreuse
- Cherry Blossom
- Christmas
- Chrono
- Chrysalis
- Clean
- Clean A
- Cleanfolio
- Cleanr
- Cleanstate - Liquid
- Cleanstate
- Clearblue
- Clearlooks
- Color Paper
- Color Paper Green
- Color Paper Orange
- Color Paper Pink
- Color Paper Purple
- Color Paper Super
- Colorart
- Colorfulness
- Colourise
- Combustion
- Contented7
- Contrast
- Coolweb
- Cornflower Blue
- CristalX4Drupal
- Deep Sky Blue
- Navy
- Orange Red
- Red
- Rhododendron Pink
- Turtle
- White
- changeme
- clear_dark
- coolwater
- D
- Drupal
- E
- F
- G
- GBIF
- Gainsboro
- Gardening
- Garfirst
- Garfish
- Garland
- Garland Accessible
- Genesis
- Genesis DARK
- Genesis LITE
- Genesis SUBTHEME
- Genesis Typo 1
- Genesis WebX
- Genesis Webify
- Genesis Zine
- German Newspaper
- Giordani
- GlossyBlue
- Gnifetti
- Golden Hour
- Goldfish
- Goofy
- Grass
- Grassland
- Green House
- Green'n'Black
- Greeny_Blu
- Gulmohar
- greens
- H
- I
- J
- K
- L
- M
- N
- O
- P
- Q
- R
- S
- Salamander
- Salamander Skins
- SanQ
- SanQReaL
- Sandium
- Sandtiger
- Sapo
- Scaccarium
- Scratch
- Scruffy
- Sea Breeze
- Seven
- Shallow Grunge
- Sharepoint-like
- Simpla - Liquid
- Simpla
- Simple Blog
- Simpler
- Simplex2
- Simply Green
- Simply Modern
- Sky
- Skyliner
- Skyroots
- Slash
- Slash black
- Slash blue
- Slash green
- Smooth Blue
- Social Networking Dream
- Solarflare
- Soldier
- Sports
- Spring Bloom
- Spring Theme
- Stark
- Starkish
- Stasis
- Strange Little Town
- Strix
- Summertime
- Sunny Sky
- Sunset
- SuperClean
- SynFox
- T
- The Big List
- U
- V
- Validators
- W
- X
- Y
- Z
Notes on converting a Drupal 6 theme in preparation for Drupal 7
Submitted by peter on Mon, 04/26/2010 - 17:09
Drupal 7 themes are similar to Drupal 6 themes and Drupal 6 themes can be changed to work more like Drupal 7 themes so that there is less code to change when you convert. If you use the one theme on many sites, you can maintain the code in parallel for both releases because a lot of the code will work the same across both releases.
The official Drupal documentation on a conversion is in Converting 6.x themes to 7.x but it is a one way conversion and you end up maintaining two versions in parallel. The notes here are about making changes to the Drupal 6 theme so that some of the code will automatically work in Drupal 7 and some of the Drupal 7 region changes will occur in your Drupal 6 sites.
template.php
Your theme contains a template.php file to process theme related data before running page.tpl.php and other files. Place the following code among the PHP code at the top of your template.php file to create a function you can test throughout your theme files and modify all the code in preparation for Drupal 7. The code works because the Drupal system module contains a define, define('VERSION', '6.16');, to document the Drupal release in use.
function aardvark_d7()
{
static $d7;
if(!isset($d7))
{
$d7 = false;
$version_parts = explode('.', VERSION);
if($version_parts[0] == 7)
{
$d7 = true;
}
}
return $d7;
}
page.tpl.php
Your theme contains a page.tpl.php file to print out the page and place the regions within the page. Place the following conditional statement among the PHP code at the top of your page.tpl.php file. Code specific to Drupal 7 can be added in the first section, if(aardvark_d7) { }, and code specific to Drupal 6 can be added in the second section, else { }.
if(aardvark_d7)
{
}
else
{
}
$search_box
The search box is available in Drupal 6 as a block to go in a region or as $search_box in your page.tpl.php. $search_box does not exist in Drupal 7. Just use the block and remove $search_box from your theme. If you want something unusual, set up a region for the search block.
Some other changes
$footer_message is removed in Drupal 6 and was rarely used in Drupal 6. You can usually remove $footer_message from page.tpl.php without seeing a difference. If a module produces a message in $footer_message, the module should be changed to create a block and the block then placed in the footer region.
The following pages are based on converting the Aardvark theme for compatibility across Drupal 6 and 7. Some files, including page.tpl.php become identical across the two releases. Some use the $d7 variable created on this page and some add code to either the D6 part of the conditional statement, some add code to the D7 part, and some add code to both parts.
- body_classes changes to classes
- Closure, Page top, and Page bottom converts the current closure region to the new Page top and Page bottom regions.
- jQuery UI added to core to add fancy effects using jQuery and the jQuery UI library.
- node_get_types() renamed to node_type_get_types()
- Skip to skip-link
Content block title
Content block body. This block shows you what a block looks like in the content region.
