No announcement yet.

Bug in template system

  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in template system

    (I posted this to tech support as a ticket but thought I'd post here to give you a heads up and see if anyone else has encountered this and possibly found a workaround)

    I am trying to update the category_0.html file and clean up some of the code. I am trying to remove the use of the <font> tag (since it has been deprecated a long time ago) and replace it with CSS styles.
    I discovered that changing ANYTHING in the sections marked between the
    <!--START: PAGING--> <!--END: PAGING--> tags would mess up the links, even if the code was completely valid. Simply changing this line:
    PHP Code:
    <a href="view_category.asp?cat=[cat]&amp;sortby=[sortby]&amp;page=[prev]">[category_previouspage]</a

    PHP Code:
    <a href="view_category.asp?cat=[cat]&amp;sortby=[sortby]&amp;page=[prev]">test</a
    would break everything, and cause the links to look as they do in this image:
    This is clearly a bug in the template system and is preventing me from customizing my site.


  • #2
    ok, easy fix.

    The block is twice on the page, but its only replaced once. Its setup to be the same on both top and bottom of the page. So, most likely what happened here is that you changed one, but not the other, so its only finding it once.

    Easy fix:

    Take the one you modified, from the START...all the way to the last END... and copy -> Paste it were the other block is. Ie. if you modified the top one, copy it and paste it on the bottom of the page overwriting the one on the bottom.

    That should fix this issue for you.
    Gonzalo Gil
    3dCart Support
    800-828-6650 x111


    • #3
      Thanks Gil. That solved it.
      One related question, I have one more validation error on my category listing page (such as: )
      which I am trying to track down.
      In the source code, the line with the error is:
      <!--START: CATEGORY_ITEMS--><TR valign="top" align="center"><TD width="50%">
      I believe the width attribute is illegal there under 4.01 strict. However that code does not appear anywhere at all in the category_0.html file. I'm stumped!


      • #4
        Actually now that I think about it I assume that the <td> tag is generated by the 3DCart template system which is what makes the repeating tables work. If so, probably can't be fixed. Oh well, I can live with one validation error on my category pages.


        • #5
          I am still trying to get my head around how the template system worked. I assumed that for code blocks where there would be repeating data, for example:
          crm.html, the <!--START: msgDetail--> which includes a history of recent messages.
          The template obviously depends on it being <table> data and it supplies the additional <tr> and <td> tags needed to make it a valid table.

          I experimented with it today and have been fairly successfully made a CSS-based list of message history, and for some reason the template system does not supply any extraneous table tags.

          My code looks like this:
          <h3>Message History</h3>
          	<div><!-- Message history table-->
          		<div style="width:15em;float:left"><b>User/Date</b></div>
          		<div style="width:30em;float:left"><b>Message</b></div>
          		<!--START: msgDetail--><br>
          		<div style="width:15em;float:left;margin-top:5px">[msgSender]<br>[msgDate]</div>
          		<div style="width:30em;float:left;margin-top:5px">[msgMessage]</div><br>
          		<!--END: msgDetail-->
          The code that gets generated is just repeated with an extra <br> tag. Does the template system try to detect the presence of a table, or does it just repeat the tag immediately following the <!-- START > command?