I just put my magento site in a sub directory, e.g. /store/, then in the /store/app/Mage.php file I added the following line to the include paths:
$paths[] = '/home/USER/public_html/system/templates/global/';
Then I was able to include my main site’s header and footer files, so the Magento site instantly has the same styles and layout available to it. Every page in the /store/ section runs through the 1column.phtml file, so the change was easy, and at the top of that file I have the following code:
<?php
$mage_head_content = $this->getChildHtml('head');
$mage_page_title = str_replace(' - Default Store View', '', $this->getLayout()->getBlock('head')->getTitle());
include 'header.php';
unset($mage_head_content);
unset($mage_page_title);
?>
Fortunately I don’t have much EE template logic in my header, but it does look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<title>
<?php echo (isset($mage_page_title)) ? $mage_page_title . '- ' : '
{if embed:mysection == "home"}
Home -
{if:elseif embed:page_title != ""}
{embed:page_title} -
{if:elseif segment_2 == ""}
{exp:weblog:entries weblog="{embed:mysection}" url_title="{segment_1}" limit="1" disable="member_data|trackbacks|pagination" sort="desc"}
{title} -
{/exp:weblog:entries}
{if:else}
{exp:weblog:entries weblog="{embed:mysection}" limit="1" disable="member_data|trackbacks|pagination" sort="desc"}
{title} -
{/exp:weblog:entries}
{/if}';
?>
Site Title
</title>
<!-- JS and CSS includes here -->
<?php echo (isset($mage_head_content)) ? $mage_head_content : ''; ?>
That big conditional is kinda ugly, but it allows me to use the same header and footer for EE templates, and in my Magento store, and it passes the page title of the store items, and all the necessary JS Magento needs to that header template. Sure I could have managed 2 different header files, but that would be a pain, and this solution wasn’t that hard.