Making Your Not Found Page More Useful (NTFD)

When Miva Merchant 5.5 Production Release 6 was released back on July 28, 2009, there were numerous updates and changes. One of the new items added was a page called NTFD (Not Found). From the release announcement, “The software now routes requests for pages, products, or categories that do not exist to this page.”

By default, the page takes on whatever your site’s basic styling is and will relate the following messages based on the request that was made:

  • Page: Page ‘xx’ no longer exists.
  • Category: Category ‘xx’ is not available at this time.
  • Product: Product ‘xx’ is not available at this time.

Now this is all fine, it tells that what I had a link for is no longer available. But what do I do now? If it was a link for a product, are there any replacements or suggestions for it? It would be great to have a little guidance in this area. This is where some creative IF statements come in handy. Use the code below to replace the default NTFD page code and turn your response messages into something more useful like…

  • Page:
    We’re sorry but it appears that the “xx” page is not available at this time.
    Please click here to return to our home page.
  • Category:
    We’re sorry but it appears that the “xx” category is not available at this time.
    Please check our Site Map or click here to return to our home page.
  • Product:
    We’re sorry but it appears that product “xx” is not available at this time.
    Please check our Product Index or perform a Search to find a similar product.
    * For best results, if a product has been made inactive or removed from the store, make a note of this in a product that has superseded it to help the search function.

Below you will find the code to do this; simply copy & paste into the NTFD page template:

[sourcecode language=“html”]
<mvt:item name="html_profile" />
<head>
<title>&mvt:store:name;: Not Found</title>
<base href="&mvt:global:basehref;" />
<mvt:item name="head" param="head_tag" />
</head>
<mvt:item name="body">
<mvt:item name="hdft" param="global_header" />
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td align="left" valign="bottom" colspan="2"><mvt:item name="navbar" /></td></tr>
<tr><td align="left" valign="bottom"><mvt:item name="hdft" param="header" /></td></tr>
<tr>
<td align="left" valign="top" bgcolor="&mvt:colors:ctgy_bg;">
<table border="0" cellpadding="10" cellspacing="0">
<tr>
<td align="left" valign="top" nowrap>
<mvt:item name="fonts" param="ctgy_font">
<mvt:item name="customerlink" />
<mvt:item name="affiliatelink" />
<mvt:item name="category_tree" />
</mvt:item>
</td>
</tr>
</table>
</td>
<td align="left" valign="top" width="80%">
<br />
<blockquote>
<mvt:item name="fonts" param="body_font">
<mvt:if expr="ISNULL g.Error_Messages">
The item you requested is not available at this time.
<mvt:else>
<mvt:if expr="g.Error_Message_Count">
<mvt:foreach iterator="message" array="global:error_messages">
<mvt:if expr="‘page’ CIN l.settings:message">
<h2 style="margin:1em;">We’re sorry but it appears that the "&mvt:global:Screen;" page is not available at this time.</h2>
<p style="margin:0.75em 2em 20em;">Please <a href="&mvt:global:sessionurl;Screen=SFNT&Store_Code=&mvta:global:Store_Code;" title="Home Page">click here</a> to return to our home page.
<mvt:elseif expr="‘category’ CIN l.settings:message">
<h2 style="margin:1em;">We’re sorry but it appears that the "&mvt:global:Category_Code;" category is not available at this time.</h2>
<p style="margin:0.75em 2em 20em;">Please check our <a href="&mvt:global:sessionurl;Screen=SMAP&Store_Code=&mvta:global:Store_Code;" title="Home Page">Site Map</a> or <a href="&mvt:global:sessionurl;Screen=SFNT&Store_Code=&mvta:global:Store_Code;" title="Home Page">click here</a> to return to our home page.
<mvt:elseif expr="‘product’ CIN l.settings:message">
<h2 style="margin:1em;">We’re sorry but it appears that product "&mvt:global:Product_Code;" is not available at this time.</h2>
<p style="margin:0.75em 2em;">Please check our <a href="&mvt:global:sessionurl;Screen=PLST&Store_Code=&mvta:global:Store_Code;" title="Product Index">Product Index</a> or perform a Search to find a similar product.
<form method="post" action="&mvt:global:sessionurl;Screen=SRCH&Store_Code=&mvta:global:Store_Code;" style="margin:0.75em 2em 18em;">
<strong>Search For:</strong> <input type="text" name="Search" size="40" value="&mvt:global:Product_Code;" style="vertical-align:middle;" /> <mvt:item name="buttons" param="Search" />
</form>
<mvt:else>
<h2>&mvt:message;</h2>
</mvt:if>
</mvt:foreach>
</mvt:if>
</mvt:if>
</mvt:item>
</blockquote>
</td>
</tr>
<tr><td align="left" valign="bottom"><mvt:item name="hdft" param="footer" /></td></tr>
</table>
<mvt:item name="hdft" param="global_footer" />
</mvt:item>
</html>
[/sourcecode]

Until next time, happy coding.

Matt Zimmermann
Miva Merchant