Create a folder called 'mytheme' in the themes folder of your Drupal local installation. Open the Joomla! template folder, you have index.php, template.css/php inside the folder 'css', 'image' folder and an xml file named template details. Copy the image folder, index.php and template.css to 'mytheme'.
Rename index.php to page.tpl.php and template.css to style.css.
Open the page.tpl.php in your favorite editor. Replace the following:
- HTML head
Joomla!
<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); $iso = split( '=', _ISO ); echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">// <head> <?php if ( $my->id ) { initEditor(); } ?> <?php mosShowHead();?> <link rel="shortcut icon" href="favicon.ico" /> <link href="<?php echo $mosConfig_live_site;?>/templates/bt_musemix/css/template_css.css" rel="stylesheet" type="text/css" /> </head>
Drupal
<?php // $Id:$ ?> <!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="<?php print $language->language ?>" lang="<?php print $language->language ?>">//. <head> <title><?php print $head_title ?></title> <?php print $head ?> <?php print $styles ?> <?php print $scripts ?> <!--[if lt IE 7]> <?php print phptemplate_get_ie_styles(); ?> <![endif]--> </head>
- Body tag
Joomla!
<body>
Drupal
<body<?php print phptemplate_body_class($left, $right); ?>
- Site name
Joomla!
<?php echo $mosConfig_sitename; ?>
Drupal
<?php if ($site_name): ?> <h1 id='site-name'> <a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"> <?php print $site_name ?> </a> </h1> <?php endif; ?>
Additionally you may add site slogan and logo:
<?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?> <?php if ($site_slogan) { ?><div class='site-slogan'><?php print $site_slogan ?></div><?php } ?>
- Pathway/Breadcrumb
Joomla!
<?php mospathway() ?>
Drupal
<?php print $breadcrumb; ?>
- Main body/Content
Joomla!
<div class="mainbody"><?php mosMainBody(); ?></div>
Drupal
<?php print $content ?> <code> Add these variable before the $content. This is not available in Joomla!. <code> h1 class="title"><?php print $title ?></h1> <div class="tabs"><?php print $tabs ?></div> <?php print $help ?> <?php if ($show_messages) { print $messages; } ?>
And site feed any where on the site but usually the content variable.
- Left Sidebar
Joomla!
<?php if (mosCountModules('left')>0) mosLoadModules('left',-1); ?>
Drupal
<?php if ($sidebar_left): ?> <?php print $sidebar_left ?> <?php endif; ?>
- Right sidebar
Joomla!
<?php if (mosCountModules('right')>0) mosLoadModules('right',-1); ?>
Drupal
<?php if ($sidebar_right): ?> <?php print $sidebar_right ?> <?php endif; ?>
- Primary links
Joomla!
<?php if (mosCountModules('user3')>0) mosLoadModules('user3',-1); ?>
Drupal
<?php if (isset($primary_links)) : ?> <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?> <?php endif; ?>
- Search
Joomla!
<form action="index.php" method="post"> <input class="inputbox" type="text" name="searchword" size="15" value="<?php echo _SEARCH_BOX; ?>" onblur="if(this.value=='') this.value='<?php echo _SEARCH_BOX; ?>';" onfocus="if(this.value=='<?php echo _SEARCH_BOX; ?>') this.value='';" /> <input type="hidden" name="option" value="search" /> </form>
Drupal
<?php print $search_box ?>
- Footer
Joomla!
<?php mosLoadModules('bottom', 0); ?>
Drupal
<?php print $footer_message ?>
- Body close
Joomla!
</body> </html>
Drupal
<?php print $closure ?> </body> </html>
Drupal 6 only
And finally, if you using Drupal 6 create a text file called mytheme.info
and copy the below code to that file, replacing "mytheme" with the name of your theme.
; $Id:$
name = mytheme
description = CSS and. XHTML Strict/Modular layout theme
core = 6.x
engine = phptemplate
In case your Joomla! template is version 1.5, the variables names are slightly different, but similar to the above hence you won't find any difficulty there.
Comments
D7 vs 1.5
Is there any suggestion for Drupal 7 vs Joomla! 1.5?
mimic joomla
I've been considering creating a drupal theme that mimics the joomla html output. It's ugly but it makes the conversion process a lot easier because it removes the need to change the joomla css files. Is anyone aware of such a theme?