I have never used the Expression Engine (EE) before, so this is a complete experiment. Let’s see how it goes… with the Fresh theme
page.tpl.php
From what I can see, EE has a file called index.txt that displays almost everything. This file is our page.tpl.php candidate.
- Remove the from the beginning of the index.txt file
{assign_variable:master_weblog_name="journal"}
{assign_variable:main_template_group="bartelme"} - In the html definition, replace
{lang}
withen
– this is just a fix for en web sites – a proper i18n solution should be implemented for production sites - Replace
{exp:weblog:info weblog="{master_weblog_name}"}{blog_title}{/exp:weblog:info}
with<?php print $head_title; ?>
- Drupal adds metadata itself, so you don’t have to worry about it – so remove it
- Remove links to stylesheets and javascripts and add
<?php print $head; ?>
<?php print $styles; ?>
<?php print $scripts; ?> - Replace
{homepage}
with<?php print $base_url; ?>
- Replace
{exp:weblog:info weblog="{master_weblog_name}"}{blog_title}{/exp:weblog:info}
with<?php print $site_name; ?>
- Replace
{exp:weblog:info weblog="{master_weblog_name}"}{blog_description}{/exp:weblog:info}
with<?php print $site_slogan; ?>
- Replace the navigation block with
<?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'));
} ?> - Replace the search code
{exp:search:simple_form search_in="everywhere" result_page="search/results"}...{/exp:search:simple_form}
with<?php print $header; ?>
we will assign the search form to the header block to appear here - In the About section, replace the paragraph text with the mission statement
<?php print $mission; ?>
- In the posts section, add the Drupal messages, help, tabs and the rest
<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> - Copy the text to print the posts and paste it to node.tpl.php
- Replace the code
{exp:weblog:entries weblog="{master_weblog_name}" limit="1" sort="desc" orderby="date"}...{/exp:weblog:entries}
and{exp:weblog:entries weblog="{master_weblog_name}" limit="2" offset="1" sort="desc" orderby="date"}...{/exp:weblog:entries}
with<?php if ((strlen($content) > strlen('<div class="post-meta">')) && (substr($content, 0, strlen('<div class="post-meta">')) == '<div class="post-meta">')) {
print $content;
} else {
print '<div class="post-main">' . $content . '</div>';
} ?>
<div class="clear-block clear"></div> - Remove the Comments block as this is also managed by Drupal
- Replace the code inside the sidebar-wrapper with
<php print $sidebar_left . $sidebar_right; ?>
- Replace the code inside the footer section with
<?php print $footer_message; ?>
The final page.tpl.php file looks like
<!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="en" lang="en">
<head>
<title><?php print $head_title; ?></title>
<?php print $head; ?>
<?php print $styles; ?>
<?php print $scripts; ?>
<!--[if lt ie 7]><link rel="stylesheet" type="text/css" media="screen" href="ie_win_css" /><![endif]-->
</head>
<body id="bhome">
<p id="skip"><a href="#content">Skip to main content</a></p>
<div id="header">
<h1><a href="<?php print base_path() ?>"><?php print $site_name; ?></a></h1>
<h2><?php print $site_slogan; ?></h2>
</div>
<div id="navigation">
<?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'));
} ?>
<div id="search">
<?php print $header; ?>
</div>
</div>
<div id="wrapper">
<div id="content-wrapper">
<div id="content">
<div class="about">
<h3><a href="#.vcf" class="vcard"><?php print t('About'); ?></a></h3>
<p><?php print $mission; ?></p>
</div>
<div class="posts">
<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 if ((strlen($content) > strlen('<div class="post-meta">')) && (substr($content, 0, strlen('<div class="post-meta">')) == '<div class="post-meta">')) {
print $content;
} else {
print '<div class="post-main">' . $content . '</div>';
} ?>
<div class="clear-block clear"></div>
</div>
</div>
</div>
<div id="sidebar-wrapper">
<?php print $sidebar_left . $sidebar_right; ?>
</div>
</div>
<div id="footer">
<?php print $footer_message; ?>
<div id="meta">
<p>
Design Copyright &copy; 1999 &ndash; 2006 <a href="http://www.bartelme.at/">Wolfgang Bartelme</a> |
Theme Ported by <a href="http://www.nikhedonia.com/" title="SimplyGold">Sadhana Ganapathiraju</a>
</p>
<ul>
<li><a href="http://validator.w3.org/check/referer" title="Xhtml 1.0 Strict"><span>Xhtml Happy</span></a></li>
<li><a href="http://jigsaw.w3.org/css-validator/check/referer" title="Css 2.0 Strict"><span>Css Happy</span></a></li>
<li><a href="http://www.contentquality.com/fulloptions.asp?Url1=http://www.example.com/"><span>508</span></a></li>
</ul>
</div>
</div>
</body>
</html>
node.tpl.php
As mentioned above, strip out the part of the index.txt file that deals with posts (or nodes in Drupal-talk) and put it into a node.tpl.php file.
- The new node.tpl.php file should contain and all this needs to be converted
<div class="post">
<h2 class="post-title"><a href="{entry_id_path=bartelme/comments}" title="Read '{title}'">{title}</a></h2>
<div class="post-meta">
<em>{entry_date format="%d %M %Y"}</em>
<a class="comments" href="{permalink}#comments">{comment_total} Comments</a>
</>
<div class="post-content">
{exp:markdown}{summary}{/exp:markdown}
<a href="{entry_id_path=bartelme/comments}" class="more">continue reading "{title}"</a>
</div>
</div> - Replace
{entry_id_path=bartelme/comments}
with<?php print $node_url; ?>
- Replace
{title}
with<?php print $title; ?>
- Replace
{entry_date format="%d %M %Y"}
with<?php print date('d M Y', $node->created); ?>
- Replace the comments section with
<?php if ($links) { print '<div class="comments">' . $links . '</div>'; } ?>
- Replace
{exp:markdown}{summary}{/exp:markdown}
with<?php if ($page == 0) { print '<h2><a class="post-title" href="' . $node_url . '" title="' . $title . '">' . $title . '</a></h2>'; } ?>
- Replace
<a href="{entry_id_path=bartelme/comments}" class="more">continue reading "{title}"</a>
with<div class="post-entry">
<?php print $content ?>
</div>
<div class="clear-block clear"></div> - Add a line to print the taxonony terms
<?php if ($taxonomy) { print '<div class="terms">' . $terms . '</div>'; } ?>
The final node.tpl.php file should look something like the following
<div class="post">
<h2 class="post-title"><a href="<?php print $node_url; ?>" title="<?php print $title; ?>"><?php print $title; ?></a></h2>
<div class="post-meta">
<span class="submitted"><?php print date('d M Y', $node->created); ?></span>
<?php if ($taxonomy) { print '<div class="terms">' . $terms . '</div>'; } ?>
<?php if ($links) { print '<div class="comments">' . $links . '</div>'; } ?>
</div>
<div class="post-content">
<?php if ($page == 0) { print '<h2><a class="post-title" href="' . $node_url . '" title="' . $title . '">' . $title . '</a></h2>'; } ?>
<div class="post-entry">
<?php print $content ?>
</div>
<div class="clear-block clear"></div>
</div>
</div>
comment.tpl.php
Copy the node.tpl.php file to comment.tpl.php.
- Update it a bit to suit comments and you have something like
<div class="post">
<h3><?php print $title; ?></h3>
<div class="post-meta">
<span class="submitted"><?php print date('d M Y', $comment->timestamp); ?></span>
<?php if ($comment->new) { print '<a id="new"></a>' . '<span class="new">' . drupal_ucfirst($new) .'</span>'; } ?>
<?php if ($links) { print '<div class="post-tags">' . $links . '</div>'; } ?>
</div>
<div class="post-content">
<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print (isset($comment->status) && $comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; print ' '. $zebra; ?>">
<?php print $picture ?>
<div class="post-entry">
<?php print $content ?>
</div>
<div class="clear-block clear"></div>
</div>
</div>
</div>
style.css
The rest of the work is CSS related – find out what does not work, update the CSS to use the Drupal names and fix the problems one at a time.
The result
- Home page
- Node
- Node edit
What it should look like
To do
There is still a lot to do - CSS mostly - but the core is there.
Comments
good
good