Porting A Joomla Template To Drupal - A simple Aproach

Create a folder called 'mytheme' in the themes folder of your drupal local installation. Open the Joomla tempate folder, you have index.php, template.css/php inside the folder 'css', 'image' foder and an xml file named template detailes. 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 as following

Step 1

Joomla header

<?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] .'"?' .'>';
?>

//

<?php
if ( $my->id ) { initEditor(); }
?>

<?php
mosShowHead
();
?>

Druplal header

<?php
// $Id: page.tpl.php,v 1.15 2007/11/04 15:01:39 goba Exp $
?>

//.

<?php
print $head_title
?>

<?php
print $head
?>

<?php
print $styles
?>

<?php
print $scripts
?>

<?php
print phptemplate_get_ie_styles();
?>

Step2

joomla

Drupal

..................

Step3

joomla

site name

<?php
echo $mosConfig_sitename;
?>

Drupal

<?php
if ($site_name):
?>

<?php
print $base_path
?>

" title="
<?php
print t('Home')
?>
" rel="nofollow">
<?php
print $site_name
?>


<?php
endif;
?>

Additionally you may add site slogan and logo

<?php
if ($logo) {
?>
<?php
print $base_path
?>

" title="
<?php
print t('Home')
?>
" rel="nofollow">
<?php
}
?>

<?php
if ($site_slogan) {
?>
<?php
print $site_slogan
?>
<?php
}
?>

Step4

Joomla

Pathway

<?php
mospathway
()
?>

Drupal

Breadcrumb

<?php
print $breadcrumb;
?>

Step5

joomla

main body

<?php
mosMainBody
();
?>

Drupal

Content

<?php
print $content
?>

Add these veriable before the $content, This is not availabe in joomla

h1 class="title">

<?php
print $title
?>

<?php
print $tabs
?>

<?php
print $help
?>

<?php
if ($show_messages) { print $messages; }
?>

And site feed any where on the site but usally the content verialbe

step6

Jomla

left block

<?php
if (mosCountModules('left')>0) mosLoadModules('left',-1);
?>

Drupal

left sidebar

<?php
if ($sidebar_left):
?>

<?php
print $sidebar_left
?>

<?php
endif;
?>

Step7

joomla

right block

<?php
if (mosCountModules('right')>0) mosLoadModules('right',-1);
?>

Drupal rightside bar

<?php
if ($sidebar_right):
?>

<?php
print $sidebar_right
?>

<?php
endif;
?>

Step8

Joomla user 3

<?php
if (mosCountModules('user3')>0) mosLoadModules('user3',-1);
?>

Drupal primary links

<?php
if (isset($primary_links)) :
?>

<?php
print theme('links', $primary_links, array('class' => 'links primary-links'))
?>

<?php
endif;
?>

step9

joomla

search

Drupal

search

<?php
print $search_box
?>

Step10

Joomla

footer

<?php
mosLoadModules
('bottom', 0);
?>

Drupal

Footer

<?php
print $footer_message
?>

Step11

joomla

body close

And finally, this is for Druapal 5 theme if you using the Drupal 6 create a text file called 'mytheme.info' and copy the below code to that file.

; $Id: cmsproducer.info,v 1.0 2007/08/20 15:50:57 Exp $
name = mytheme
description = CSS and. XHTML Strict/Modular layout theme
version = VERSION
core = 6.x
engine = phptemplate
; Information added by iDonny Productions 2007-08-20
version = "6.x-dev"
core = "6.x"
project = "drupal"
datestamp = "1186963423"

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.

 
 

Drupal is a registered trademark of Dries Buytaert.