Top Tags

Blog Theme for Expression Engine convert to Drupal

I have never used the Expression Engine (EE) before, so this is a complete experiment. Let's see how it goes...

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 {assign_variable:master_weblog_name="journal"}
    {assign_variable:main_template_group="bartelme"}
    from the beginning of the index.txt file
  • In the html definition, replace @{lang}@ with @en@ - 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 @@
  • Drupal adds metadata itself, so you don't have to worry about it - so remove it
  • Remove links to stylesheets and javascripts and add

  • Replace @{homepage}@ with @@
  • Replace @{exp:weblog:info weblog="{master_weblog_name}"}{blog_title}{/exp:weblog:info}@ with @@
  • Replace @{exp:weblog:info weblog="{master_weblog_name}"}{blog_description}{/exp:weblog:info}@ with @@
  • Replace the navigation block with print theme('links', $primary_links, array('class' => 'navmenu primary-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 @@ 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 @@
  • In the posts section, add the Drupal messages, help, tabs and the rest

    '. $mission .'

    '; } ?>

    '; } ?>

    '. $title .'

    '; } ?>

    '; } ?>


  • 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 strlen('
  • Remove the Comments block as this is also managed by Drupal
  • Replace the code inside the sidebar-wrapper with @
    @
  • Replace the code inside the footer section with @@
  • The final page.tpl.php file looks like



    <?php print $head_title; ??>



    Skip to main content


    '. $mission .'

    '; } ?>

    '; } ?>

    '. $title .'

    '; } ?>

    '; } ?>


    strlen('


    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

      {title}

      {exp:markdown}{summary}{/exp:markdown}
      continue reading "{title}"

      and all this needs to be converted
    • Replace @{entry_id_path=bartelme/comments}@ with @@
    • Replace @{title}@ with @@
    • Replace @{entry_date format="%d %M %Y"}@ with @created); ?>@
    • Replace the comments section with @
      ' . $links . '

      '; } ?>@

    • Replace @{exp:markdown}{summary}{/exp:markdown}@ with @

      ' . $title . '

      '; } ?>@

    • Replace @continue reading "{title}"@ with

    • Add a line to print the taxonony terms @
      ' . $terms . '

      '; } ?>@

    The final node.tpl.php file should look something like the following

    ' . $title . '

    '; } ?>

    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


    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.