(Tutorial) Convert a Word Press theme to Drupal
Tutorial : Convert a Word Press theme to Drupal
The example WP theme I am trying to use is sodelicious_black.
page.tpl.php
Combine header.php, page.php and footer.php into on new file called page.tpl.php. In this new page.tpl.php file:
Replace your DOCTYPE and HTML lines with
<!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">
Replace the TITLE with
<title><?php print $head_title ?></title>
Replace the links to style sheets, RSS news feeds and the such with
<?php print $head ?>
<?php print $styles ?>
<?php print $scripts ?>
- Clean up the page.tpl.php by removing the obsolete calls to
get_header()andget_footer()- Replace
echo get_settings('home')withprint base_path()- Replace
bloginfo('name')withprint $site_slogan ? $site_slogan : $site_name- Drupal uses syntax such as
<?php if (isset($primary_links)) {
print theme('links', $primary_links, array('class' => 'navmenu primary-links'));
} ?>
<?php if (isset($secondary_links)) {
print theme('links', $secondary_links, array('class' => 'navmenu secondary-links'));
} ?>At the beginning of the main content block, Drupal customarily has a bunch of information such as
for navigation, so replace the navigation block with this code
<div class="post-main">
<?php if ($breadcrumb) { print $breadcrumb; } ?>
<?php if ($mission) { print '<div id="mission">'. $mission .'</div>'; } ?>
<?php if ($tabs) { print '<div id="tabs-wrapper" class="clear-block">'; } ?>
<?php if ($title) { print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; } ?>
<?php if ($tabs) { print $tabs .'</div>'; } ?>
<?php if (isset($tabs2)) { print $tabs2; } ?>
<?php if ($help) { print $help; } ?>
<?php if ($show_messages && $messages) { print $messages; } ?>
</div>
<?php print $content; ?>
- The Search blocks are created by Drupal, so remove any code builds a search block – just remember where it was located (top, left, centre, right, footer regions)
- Replace
get_sidebar();withprint $sidebar_left . $sidebar_right;
- The Recent Posts blocks are created by Drupal, so remove any code that builds a Recent Posts block – just remember where it was located
- Clean up the code and balance all your DIV’s and SPAN’s
[Read more..]
Courtesy : Amadain.net
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)