I have changed the Dynamic Error Pages Template to make it look almost the same as my Main Index page.
Everything looks fine, except the monthly archive listing on the right sidebar which shows the following error message:-
SQL/DB Error -- [You have an error in your SQL syntax near 'and entry_status = 2 group by extract(ye' at line 6]
The following is the template code:-
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<$MTPublishCharset$>" />
<meta name="generator" content="http://www.movabletype.org/" />
<title><$MTBlogName encode_html="1"$></title>
<link rel="stylesheet" href="<$MTBlogURL$>styles-site.css" type="text/css" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="<$MTBlogURL$>atom.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="<$MTBlogURL$>index.rdf" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<$MTBlogURL$>index.xml" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="<$MTBlogURL$>rsd.xml" />
<MTBlogIfCCLicense>
<$MTCCLicenseRDF$>
</MTBlogIfCCLicense>
</head>
<body>
<div id="container">
<div id="banner">
<h1><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1>
<h2><$MTBlogDescription$></h2>
</div>
<div id="center">
<div class="content">
<div class="entrysad">
<div class="error404">
<p>The requested page could not be found.</p>
<h4 class="error-message"><$MTErrorMessage$></h4>
</div>
</div>
</div>
</div>
<div id="right">
<div class="sidebar">
<div id="calendar">
<table summary="Monthly calendar with links to each day's posts">
<caption><$MTDate format="%B %Y"$></caption>
<tr>
<th abbr="Sunday">Sun</th>
<th abbr="Monday">Mon</th>
<th abbr="Tuesday">Tue</th>
<th abbr="Wednesday">Wed</th>
<th abbr="Thursday">Thu</th>
<th abbr="Friday">Fri</th>
<th abbr="Saturday">Sat</th>
</tr>
<MTCalendar>
<MTCalendarWeekHeader><tr></MTCalendarWeekHeader>
<td><MTCalendarIfEntries>
<MTEntries lastn="1"><a href="<$MTEntryPermalink$>"><$MTCalendarDay$></a></MTEntries>
</MTCalendarIfEntries>
<MTCalendarIfNoEntries><$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank> </MTCalendarIfBlank></td>
<MTCalendarWeekFooter></tr></MTCalendarWeekFooter>
</MTCalendar>
</table>
</div>
<h2>Search</h2>
<div class="link-note">
<form method="get" action="<$MTCGIPath$><$MTSearchScript$>">
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />
<label for="search" accesskey="4">Search this site:</label><br />
<input id="search" name="search" size="20" /><br />
<input id="searchsubmit" type="submit" value="Search" />
</form>
</div>
<h2>Archives</h2>
<ul>
<MTArchiveList archive_type="Monthly">
<li><a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a></li>
</MTArchiveList>
</ul>
<h2>Recent Entries</h2>
<ul>
<MTEntries lastn="10">
<li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li>
</MTEntries>
</ul>
<h2>Sections</h2>
<ul>
<MTEntries category="Pages">
<li><a href="<$MTEntryPermalink archive_type="Individual"$>"><$MTEntryTitle$></a></li>
</MTEntries>
<li><a href="http://www.bangsar.net/cgi-main/awstats.pl">Statistics</a></li>
</ul>
<div class="link-note">
<a href="<$MTBlogURL$>index.rdf">Syndicate this site (XML)</a>
</div>
<MTBlogIfCCLicense>
<div class="link-note">
<a href="<$MTBlogCCLicenseURL$>"><img alt="Creative Commons License" src="<$MTBlogCCLicenseImage$>" /></a><br />
This weblog is licensed under a <a href="<$MTBlogCCLicenseURL$>">Creative Commons License</a>.
</div>
</MTBlogIfCCLicense>
<div id="powered">
Powered by<br /><a href="http://www.movabletype.org">Movable Type <$MTVersion$></a><br />
</div>
<div id="logo1">
</div>
<div id="logo2">
</div>
</div>
</div>
<div style="clear: both;"> </div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<$MTPublishCharset$>" />
<meta name="generator" content="http://www.movabletype.org/" />
<title><$MTBlogName encode_html="1"$></title>
<link rel="stylesheet" href="<$MTBlogURL$>styles-site.css" type="text/css" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="<$MTBlogURL$>atom.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="<$MTBlogURL$>index.rdf" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<$MTBlogURL$>index.xml" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="<$MTBlogURL$>rsd.xml" />
<MTBlogIfCCLicense>
<$MTCCLicenseRDF$>
</MTBlogIfCCLicense>
</head>
<body>
<div id="container">
<div id="banner">
<h1><a href="<$MTBlogURL$>" accesskey="1"><$MTBlogName encode_html="1"$></a></h1>
<h2><$MTBlogDescription$></h2>
</div>
<div id="center">
<div class="content">
<div class="entrysad">
<div class="error404">
<p>The requested page could not be found.</p>
<h4 class="error-message"><$MTErrorMessage$></h4>
</div>
</div>
</div>
</div>
<div id="right">
<div class="sidebar">
<div id="calendar">
<table summary="Monthly calendar with links to each day's posts">
<caption><$MTDate format="%B %Y"$></caption>
<tr>
<th abbr="Sunday">Sun</th>
<th abbr="Monday">Mon</th>
<th abbr="Tuesday">Tue</th>
<th abbr="Wednesday">Wed</th>
<th abbr="Thursday">Thu</th>
<th abbr="Friday">Fri</th>
<th abbr="Saturday">Sat</th>
</tr>
<MTCalendar>
<MTCalendarWeekHeader><tr></MTCalendarWeekHeader>
<td><MTCalendarIfEntries>
<MTEntries lastn="1"><a href="<$MTEntryPermalink$>"><$MTCalendarDay$></a></MTEntries>
</MTCalendarIfEntries>
<MTCalendarIfNoEntries><$MTCalendarDay$></MTCalendarIfNoEntries>
<MTCalendarIfBlank> </MTCalendarIfBlank></td>
<MTCalendarWeekFooter></tr></MTCalendarWeekFooter>
</MTCalendar>
</table>
</div>
<h2>Search</h2>
<div class="link-note">
<form method="get" action="<$MTCGIPath$><$MTSearchScript$>">
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />
<label for="search" accesskey="4">Search this site:</label><br />
<input id="search" name="search" size="20" /><br />
<input id="searchsubmit" type="submit" value="Search" />
</form>
</div>
<h2>Archives</h2>
<ul>
<MTArchiveList archive_type="Monthly">
<li><a href="<$MTArchiveLink$>"><$MTArchiveTitle$></a></li>
</MTArchiveList>
</ul>
<h2>Recent Entries</h2>
<ul>
<MTEntries lastn="10">
<li><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></li>
</MTEntries>
</ul>
<h2>Sections</h2>
<ul>
<MTEntries category="Pages">
<li><a href="<$MTEntryPermalink archive_type="Individual"$>"><$MTEntryTitle$></a></li>
</MTEntries>
<li><a href="http://www.bangsar.net/cgi-main/awstats.pl">Statistics</a></li>
</ul>
<div class="link-note">
<a href="<$MTBlogURL$>index.rdf">Syndicate this site (XML)</a>
</div>
<MTBlogIfCCLicense>
<div class="link-note">
<a href="<$MTBlogCCLicenseURL$>"><img alt="Creative Commons License" src="<$MTBlogCCLicenseImage$>" /></a><br />
This weblog is licensed under a <a href="<$MTBlogCCLicenseURL$>">Creative Commons License</a>.
</div>
</MTBlogIfCCLicense>
<div id="powered">
Powered by<br /><a href="http://www.movabletype.org">Movable Type <$MTVersion$></a><br />
</div>
<div id="logo1">
</div>
<div id="logo2">
</div>
</div>
</div>
<div style="clear: both;"> </div>
</div>
</body>
</html>
You can reproduce the error at my website, purrgatory.
On a side note, the <$MTBlogName encode_html="1"$> tag does not return any output the way it does in the Main Index.