Hi!
Okay, let's try to do a quick walkthrough.
First, you create a new directory in /serendipity/templates/, let's call it /serendipty/templats/handyman/. Inside that directory, you copy the file /serendipity/templates/info.txt, /serendipity/templates/index.tpl and /serendipity/templates/style.css.
Second, you edit the info.txt file, to give your template a unique name. Change "Name: Serendipity v2.3" to "Name: Handyman".
Third, you need to edit the index.tpl file to suit your needs. Open it in a text editor. First thing to do in this file is to copy the important parts of the HTML head area into a temporary, clean and fresh file, those are:
Code: Select all
<title>{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}</title>
<meta http-equiv="Content-Type" content="text/html; charset={$head_charset}" />
<meta name="Powered-By" content="Serendipity v.{$head_version}" />
<link rel="stylesheet" type="text/css" href="{$head_link_stylesheet}" />
<link rel="alternate" type="application/rss+xml" title="{$blogTitle} RSS feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/index.rss2" />
<link rel="alternate" type="application/x.atom+xml" title="{$blogTitle} Atom feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/atom.xml" />
{if $entry_id}
<link rel="pingback" href="{$serendipityBaseURL}comment.php?type=pingback&entry_id={$entry_id}" />
{/if}
{serendipity_hookPlugin hook="frontend_header"}
The code above is the important core information for each serendipity page.
Now, the rest that remains of this file is actually only this bit, which you also copy to a fresh temporary file:
Code: Select all
<div id="serendipity_banner">
<h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle}</a></h1>
<h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
</div>
<table id="mainpane">
<tr>
{if $leftSidebarElements > 0}
<td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
{/if}
<td id="content" valign="top">{$CONTENT}</td>
{if $rightSidebarElements > 0}
<td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
{/if}
</tr>
</table>
{/if}
{serendipity_hookPlugin hook="frontend_footer"}
This is the core instruction that will later define the layout of your blog.
Now that we have two temporary files, it's time to create your ACTUAL new index.tpl file. To do so, you simply open your homepage and save the raw HTML sourcecode to the editor.
The first thing with your copied HTML is to adjust some paths. The reason is that your main page resieds in the root, while serendipity is installed in /serendipity. To allow your homepage to load the necessary style sheets, you will need to change all your paths to have a "/" prefix.
Like, for example currently in your HTML code you use:
Code: Select all
<link rel="StyleSheet" href="corporatestyle.css" type="text/css">
but to make that appear properly when being called from serendipity it neads to read:
Code: Select all
<link rel="StyleSheet" href="/corporatestyle.css" type="text/css">
The easiest thing to do is use your text editor to search for "href" and for "src". Then add a "/" to every occurence you find.
Now your template is compatible to be opened from within the /serendipity subpage. The next step is to figure out where the serendipity content will go into.
Luckily your current HTML also has markers in it to identify where to put things, as it contains this:
Code: Select all
<!-- START CONTENT TABLE -->
...
</td></tr></table>
<!-- CONTENT TABLE -->
So you simply rip out everything between START CONTENT TABLE and CONTENT TABLE and inject your temporary code we copied earlier (the <table>.... stuff).
How we already got the main content. Now simply add the stuff from the other fresh temporary file in your<head> section.
After all that is done, save the file as "index.tpl", the go to your serendipity admin panel, disable embed mode, and then go to your template selection, pick your own template, and you're done!
Now, here's the actual HTML code from the steps above. Note though that your current HTML is using quite old legacy HTML markup that has been overriden by improved CSS and XHTML tags. Spacer.gif's for example are no longer required, a table layout could also be better replaced. But that's stuff that is on another page.
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<!-- CHANGE THE NEXT THREE LINES -->
<title>{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}</title>
<meta http-equiv="Content-Type" content="text/html; charset={$head_charset}" />
<meta name="Powered-By" content="Serendipity v.{$head_version}" />
<link rel="stylesheet" type="text/css" href="{$head_link_stylesheet}" />
<link rel="alternate" type="application/rss+xml" title="{$blogTitle} RSS feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/index.rss2" />
<link rel="alternate" type="application/x.atom+xml" title="{$blogTitle} Atom feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/atom.xml" />
{if $entry_id}
<link rel="pingback" href="{$serendipityBaseURL}comment.php?type=pingback&entry_id={$entry_id}" />
{/if}
{serendipity_hookPlugin hook="frontend_header"}
<meta name="Description" content="PC Handyman, LLC - Computer Repair, Installation, Support and Web Site Services in the Lakes Region of New Hampshire.">
<meta name="y_key" content="dad6a4dd74b54095" >
<meta name="KeyWords" content="computer repair, computer support, computer network, wireless network, computer repair housecall, Lakes Region, NH, New Hampshire, web site design, domain names, web hosting">
<!-- CHANGE THE ABOVE THREE LINES -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="Copyright" content="Copyright PC Handyman, LLC http://www.pc-handyman.net/">
<META http-equiv="Content-Language" content="en">
<META name="Rating" content="General">
<link rel="StyleSheet" href="/corporatestyle.css" type="text/css">
<script language="JavaScript" type="text/javascript" src="/javascripts.js"></script>
<script language="JavaScript" type="text/javascript" src="/pop-closeup.js"></script>
<script language="JavaScript" type="text/javascript" src="/mouseover.js"></script>
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0">
<!-- PAGE TABLE-->
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td ALIGN="LEFT" VALIGN="TOP">
<script language="JavaScript" type="text/javascript" src="http://www.pc-handyman.net/header.js"></script>
<!-- PICTURE TABLE -->
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" class="printhide"><tr><td background="picts/home.jpg">
<img src="/picts/spacer.gif" border="0" width="700" height="80" title="image"><br>
</td></tr><tr class="printhide"><td class="pagebars">
<img src="/picts/spacer.gif" width="10" height="1" title="image"><br>
</td></tr></table>
<!-- PICTURE TABLE -->
<script language="JavaScript" type="text/javascript" src="/menu.js"></script>
<!-- CORNER TABLE -->
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" background="picts/shadow1.gif" class="printhide"><tr><td width="227">
<img src="/picts/corner.gif" height="40" width="227"><br>
</td><td>
<img src="/picts/spacer.gif" height="40" width="10" border="0"><br>
</td></tr></table>
<!-- CORNER TABLE -->
<!-- OUTER TABLE-->
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td ALIGN="left" VALIGN="top" class="sidebar-background">
<!-- SPLIT TABLE-->
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td ALIGN="LEFT" VALIGN="TOP" width="15">
<script language="JavaScript" type="text/javascript" src="/pageheight.js"></script>
</td><td ALIGN="LEFT" VALIGN="TOP" width="150">
<!-- SIDEBAR AREA -->
<script language="JavaScript" type="text/javascript" src="/sidebar.js"></script>
<br>
<img src="/picts/spacer.gif" height="5" width="150" border="0"><br>
</td><td ALIGN="LEFT" VALIGN="TOP" width="30">
<img src="/picts/spacer.gif" height="400" width="30" border="0"><br>
</td><td ALIGN="CENTER" VALIGN="TOP">
<!-- START CONTENT TABLE -->
<div id="serendipity_banner">
<h1><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle}</a></h1>
<h2><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></h2>
</div>
<table id="mainpane">
<tr>
{if $leftSidebarElements > 0}
<td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
{/if}
<td id="content" valign="top">{$CONTENT}</td>
{if $rightSidebarElements > 0}
<td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
{/if}
</tr>
</table>
{/if}
{serendipity_hookPlugin hook="frontend_footer"}
<!-- CONTENT TABLE -->
</td></tr></table>
<!-- SPLIT TABLE -->
</td></tr></table>
<!-- OUTER TABLE-->
<!-- PAGE TABLE-->
</TD></TR><TR><TD VALIGN="BOTTOM">
<script language="JavaScript" type="text/javascript" src="/menu.js"></script>
<!-- BOTTOM PAGEBAR -->
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="printhide"><td class="pagebar-bottom">
<img src="/picts/spacer.gif" width="10" height="1" title="image"><br>
</td></tr></table>
<!-- COPYRIGHT -->
<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" background="picts/bottom-shade.gif"><tr><td width="10">
<img src="/picts/spacer.gif" height="45" width="10" border="0" title="image"><br>
</td><td ALIGN="left" VALIGN="middle">
<script language="JavaScript" type="text/javascript" src="/copyright.js"></script>
</td><td ALIGN="right" VALIGN="middle">
<script language="JavaScript" type="text/javascript" src="/copyright-allwebco.js"></script>
</TD><td width="10">
<img src="/picts/spacer.gif" height="10" width="10" border="0" title="image"><br>
</td></tr></table>
<!-- COPYRIGHT -->
</td></tr></table>
<!-- END PAGE TABLE-->
</BODY>
</HTML>
HTH,
Garvin