Help with Custom Template

Questions and answers about ShopSite Custom Templates

Help with Custom Template

Postby jakotsu » Mon Jun 17, 2013 12:32 pm

Hello,

I'm wondering if someone could please help me identify the root cause of this error I'm receiving for my more info product pages. I'm a novice to ShopSite tags, and I have been trying to pinpoint the root of this error for a couple hours now and it's driving me up the wall. I think I just need a second set of eyes and a point in the right direction here.

Error:
Code: Select all
product.html [68]: Template Error: Page tag illegal for this type of template
product.html [69]: Template Error: Page tag illegal for this type of template


More Info Page custom template:
Code: Select all

    [-- DEFINE PRODUCT --]
    [-- IF PRODUCT.Graphic --]
      [-- IF PRODUCT.DisplayMoreInformationPage --]
        <a href="[-- PRODUCT.MoreInfoURL --]">[-- PRODUCT.Graphic --]</a>
      [-- ELSE --]
        [-- PRODUCT.Graphic --]
      [-- END_IF --]
    [-- END_IF --]

    [-- IF PRODUCT.DisplayMoreInformationPage --]
      <a href="[-- PRODUCT.MoreInfoURL --]">[-- PRODUCT.Name --]</a>
    [-- ELSE --]
      [-- PRODUCT.Name --]
    [-- END_IF --]

    <form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post">
    <input type="hidden" name="storeid" value="[-- STORE.ID --]">
    <input type="hidden" name="dbname" value="products">
    <input type="hidden" name="function" value="add">
    <input type="hidden" name="itemnum" value="[-- PRODUCT.RecordNumber --]">
    [-- IF PRODUCT.DisplayPrice --]
    <br>
      [-- IF PRODUCT.VariablePrice? --]
        <b>[--STORE.Price --]:</b> [-- STORE.CurrencySymbol --]<input type=text name="[-- PRODUCT.RecordNumber --]:price" size="4" maxlength="10" value="">
      [-- ELSE --]
        [-- IF PRODUCT.SaleAmount --]
          <strike>[-- PRODUCT.Price --]</strike>
          [-- PRODUCT.SaleAmount --] [-- STORE.OnSaleText --]
        [-- ELSE --]
          [-- PRODUCT.Price --]
        [-- END_IF --]
      [-- END_IF --]
    [-- END_IF --]

    [-- PRODUCT.ProductDescription --]

    [-- IF PRODUCT.DisplayOrderQuantity checked --]
      <br>Quantity <input type="text" size="2" name="[-- PRODUCT.RecordNumber --]:qnty" value="1" >&nbsp;&nbsp;
    [-- END_IF --]
    <br>

    [-- IF PRODUCT.DisplayOrderingOptions --]
      <span class="opt_hdr">[-- PRODUCT.OptionText --]</span>
      [-- Order_Option_Menu Column --]
    [-- END_IF --]

    [-- IF ADDIMAGE? --]
      <input class="add" type="image" [--ADDIMAGE--]>
    [-- ELSE --]
      <input class="add" type="submit" value="[-- ADDTEXT --]">
    [-- END_IF --]
    </form>
    [-- END_DEFINE PRODUCT --]

    [-- DEFINE PRODUCT_CROSS_SELL --]
      [-- INCLUDE cross-sell-default.sst PROCESS --]
    [-- END_DEFINE PRODUCT_CROSS_SELL --]

    [-- DEFINE MORE_INFO_PAGE --]

<!DOCTYPE html>

<html>
<head>

    <meta charset="utf-8" name="keywords" content="[-- PAGE.MetaKeywords --]">
    <meta charset="utf-8" name="description" content="[-- PAGE.MetaDescription --]">
    <title>Us and We Inc. [-- IF PRODUCT.MoreInformationTitle --][-- PRODUCT.MoreInformationTitle --][-- ELSE --][-- PRODUCT.Name REMOVE_HTML --][-- END_IF --]</title>
   
    <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
   
    <link rel="stylesheet" type="text/css" href="[-- STORE.Output_URL --]/publish/reset.css">
    <link rel="stylesheet" type="text/css" href="[-- STORE.Output_URL --]/publish/styl.css">
       
    <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,600,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>

</head>

<body>
   
    <!-- *********  Header  ********** -->
   
     <div id="header">
        <div id="header_in">
       
   
        <div id="menu">
         <ul>
            <li><a href="index.html">Home</a></li>
            <li><a href="shop.html" class="active">Shop</a></li>
            <li><a href="blog.html">Blog</a></li>
            <li><a href="TC.html">Tech Corner</a></li>
            <li><a href="AC.html">About & Contact</a></li>
            <li><a href="B2B.html">B2B</a></li>         
         </ul>
        </div>
       
        </div>
    </div>
   
    <!-- *********  Main part – headline ********** -->
   
       
        <div id="main_part_inner">
            <div id="main_part_inner_in">
       
            <h2>Shop</h2>
            <h3>[-- STORE.TextA --]</h3>
           
            <!-- <div class="button_main">
                 <a href="download.html" class="button_dark">DOWNLOAD</a>
            </div> -->
           
            </div>
           
        </div>
       
       
        <!-- *********  Content  ********** -->


    <table align="center" width="100%">
      <tr>
        <td align="center">
    <form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post">
    [-- IF PRODUCT.MoreInformationGraphic --]
      [-- MoreInfoImageRow --]
    [-- END_IF --]

    [-- IF PRODUCT.Subproduct --]
    [-- ELSE --]
      [-- INCLUDE Product-Sku PROCESS --]
    [-- END_IF --]

    <p class="ProductDescription">[-- PRODUCT.MoreInformationText --]</p>

    [-- IF PRODUCT.VariablePrice? --]
      [-- IF PRODUCT.VariableName? --]
        <span class="VariableProductName">
        [-- STORE.ProductName --]: <input type=text name="[-- PRODUCT.RecordNumber --]:name" size="20" maxlength="100" value="">
        </span>
      [-- ELSE --]
        <span class="ProductName">[-- PRODUCT.Name --]</span>
      [-- END_IF --]
    [-- ELSE --]
      <span class="ProductName">[-- PRODUCT.Name --]</span>
    [-- END_IF --]

    [-- IF PRODUCT.QuantityPricing --]
    [-- ELSE --]
      [-- INCLUDE Product-Price PROCESS --]<br />
    [-- END_IF --]

    [-- INCLUDE Product-AddToCartButton PROCESS --]

    </form></td>
      </tr>
    </table>

    [-- IF Product.MoreInformationProductCrossSell --]
      [-- IF PRODUCT.CrossSell "0" --]
      [-- ELSE --]
      <table class="pcs_table">
      <caption>[-- STORE.CartCrossSellHeader --]</caption>
        [-- LOOP Product_Cross_Sell 3 --]
          <td class="gcs_table_content">[-- PRODUCT_CROSS_SELL --]</td>
        [-- END_LOOP Product_Cross_Sell --]
      </table>
      [-- END_IF --]
    [-- END_IF --]

    [-- IF Product.MoreInformationGlobalCrossSell --]
    <table class="gcs_table">
    <caption>[-- STORE.GlobalCrossSellHeader --]</caption>
      [-- LOOP GLOBAL_Cross_Sell 3 --]
        <td class="gcs_table_content">[-- GLOBAL_CROSS_SELL --]</td>
      [-- END_LOOP Global_Cross_Sell --]
    </table>
    [-- END_IF --]

   
     <!-- *********  Footer  ********** -->
   
    <hr class="cleanit">
   
     <div id="footer">
        <div id="footer_in">
           
            <p><a href="http://creativecommons.org/licenses/by/3.0/">CC Attribution 3.0 Unported</a> &mdash; allowed for commercial and non-commercial use</p>
            <span>Author: <a href="http://ries.cz">Vilém Ries</a></span>

       
        </div>
    </div>


</body>
</html>
[-- END_DEFINE MORE_INFO_PAGE --]


I basically followed the "quick & easy custom product template" step, and it's causing these errors above. Any help would be much appreciated.

Thanks.
jakotsu
 
Posts: 2
Joined: Mon Jun 17, 2013 12:08 pm

Re: Help with Custom Template

Postby Jim » Mon Jun 17, 2013 1:28 pm

The error message gives you the name of the file, the line number the error is on and what the error is.
product.html [68]: Template Error: Page tag illegal for this type of template

The template the error is occurring in is called "product.html"
The error is on line [68] and again on line 69
The type of tag that is being used is PAGE.<something> which isn't valid in a product template.

It looks like the lines that are causing the problem are
Code: Select all
        <meta charset="utf-8" name="keywords" content="[-- PAGE.MetaKeywords --]">
        <meta charset="utf-8" name="description" content="[-- PAGE.MetaDescription --]">

The meta tags for a product are
[-- PRODUCT.MoreInformationMetaKeywords --] Content of Meta Keywords tag
[-- PRODUCT.MoreInformationMetaDescription --] Content of Meta Description tag

So you would want to replace the lines above with
Code: Select all
       
        <meta charset="utf-8" name="keywords" content="[-- PRODUCT.MoreInformationMetaKeywords --]">
        <meta charset="utf-8" name="description" content="[-- PRODUCT.MoreInformationMetaDescription --]">


Note: that ShopSite uses the ISO-8955-1 character set internally so if you specify a charset of utf-8 you may get characters that do not look the same on your pages as they do in the ShopSite interface.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Help with Custom Template

Postby jakotsu » Mon Jun 17, 2013 3:13 pm

It worked. I took out the charset as well per your advice, everything is all good here. Thanks a bunch.
jakotsu
 
Posts: 2
Joined: Mon Jun 17, 2013 12:08 pm


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 11 guests

cron