Shopsite template parser question

This is an archive of old posting to the User Forum

Shopsite template parser question

Postby David » Tue Feb 03, 2004 10:12 am

I'm trying to use a template to write some html code for inclusion in
another template. The html output contains a table fragment (the intent
is to complete the table html in the template that the html is included
in). I'm having trouble getting the output to handle the table fragment
correctly. The table contains a [-- HEADER --] call and my resulting html
code seems to be including the header in its proper place in the table and
then including it again at the bottom of the table.

Does the parser simply read the input, replace the Shopsite tags and
output the html - or, is the parser doing something else behind the scenes?


The following is the end of the html generated by Shopsite:

<table cellSpacing="0" cellPadding="0" width="100%" border="1">
<tr>
<td bgcolor="#DFDFDF"><img height="10" alt=""
src="../themesmedia//spacer.gif" width="10" border="0"></td>
<td bgcolor="#DFDFDF" valign="top" height="400" width="145"></td>
<td bgcolor="#DFDFDF"><img height="10" alt=""
src="../themesmedia//spacer.gif" width="10" border="0"></td>
<td bgcolor="#FFFFFF"><img height="10" alt=""
src="../themesmedia//spacer.gif" width="10" border="0"></td>
#This should be the end of the generated HTML#
<tr>
<td width="33%"><img src="../PaymentLogo.gif"width="175" height="56"
alt="PaymentLogos.gif (9519 bytes)"></td>
</tr>
</table>

The HTML below the expected endpoint is the header (that was correctly
inserted in an earlier table) with the leading <table> tag apparently
stripped off by the parser???

I realize that I may be missing a problem in my templates, but if the
parser is doing something I don't know about I don't want to kill myself
trying to find a mistake that I didn't make.

Dave
David
 

Re: Shopsite template parser question

Postby loren_d_c » Tue Feb 03, 2004 11:21 am

Probably a problem with your template, I can see no reason why ShopSite
would include that extra code if it were not somehow defined in your
template.

-Loren


David wrote:
I'm trying to use a template to write some html code for inclusion in
another template. The html output contains a table fragment (the intent
is to complete the table html in the template that the html is included
in). I'm having trouble getting the output to handle the table fragment
correctly. The table contains a [-- HEADER --] call and my resulting
html code seems to be including the header in its proper place in the
table and then including it again at the bottom of the table.

Does the parser simply read the input, replace the Shopsite tags and
output the html - or, is the parser doing something else behind the scenes?


The following is the end of the html generated by Shopsite:

table cellSpacing="0" cellPadding="0" width="100%" border="1"
tr
td bgcolor="#DFDFDF"><img height="10" alt=""
src="../themesmedia//spacer.gif" width="10" border="0"></td
td bgcolor="#DFDFDF" valign="top" height="400" width="145"></td
td bgcolor="#DFDFDF"><img height="10" alt=""
src="../themesmedia//spacer.gif" width="10" border="0"></td
td bgcolor="#FFFFFF"><img height="10" alt=""
src="../themesmedia//spacer.gif" width="10" border="0"></td
#This should be the end of the generated HTML#
tr
td width="33%"><img src="../PaymentLogo.gif"width="175"
height="56" alt="PaymentLogos.gif (9519 bytes)"></td
/tr
/table

The HTML below the expected endpoint is the header (that was correctly
inserted in an earlier table) with the leading <table> tag apparently
stripped off by the parser???

I realize that I may be missing a problem in my templates, but if the
parser is doing something I don't know about I don't want to kill myself
trying to find a mistake that I didn't make.

Dave
loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Shopsite template parser question

Postby David » Wed Feb 04, 2004 1:34 pm

I haven't gotten everything straightened out with what is going on, but
there appears to be some curious error handling in the parser in regard to
includes. The resulting HTML can end up with parts of other files - even
when the generation yields no errors.


On Tue, 03 Feb 2004 10:21:48 -0700, Loren <loren_d_c@yahoo.com> wrote:

Probably a problem with your template, I can see no reason why ShopSite
would include that extra code if it were not somehow defined in your
template.

-Loren

[snip]
David
 

Re: Shopsite template parser question

Postby Jim » Wed Feb 04, 2004 4:34 pm

David,
Could you send me copies of all files involved with this problem and
I'll look at it for you. Also explain please what you are trying to
accomplish.

Jim

David wrote:

I haven't gotten everything straightened out with what is going on, but
there appears to be some curious error handling in the parser in regard
to includes. The resulting HTML can end up with parts of other files -
even when the generation yields no errors.


On Tue, 03 Feb 2004 10:21:48 -0700, Loren <loren_d_c@yahoo.com> wrote:

Probably a problem with your template, I can see no reason why
ShopSite would include that extra code if it were not somehow defined
in your template.

-Loren

[snip]
Jim
 

Re: Shopsite template parser question

Postby David » Mon Feb 09, 2004 12:38 pm

On Tue, 03 Feb 2004 10:21:48 -0700, Loren <loren_d_c@yahoo.com> wrote:

Probably a problem with your template, I can see no reason why ShopSite
would include that extra code if it were not somehow defined in your
template.

-Loren


The parser is up to some tricks:

It looks for the string 'head' in order to insert the meta-generator
text. If you are using a template to write html fragments or text - you
wouldn't necessarily be inserting the <head> tag - leaving the parser
waiting to trigger on the first instance of 'head' - such as [-- HEADER
--] or the instance of 'head' found buried deep within the CSS include for
the MiniCart. You can give the parser 'head' via a comment (html, script
acceptable - but what about text?)

Jim tracked this one down for me. (Thanks, Jim.)


Dave
David
 


Return to User Forum Archive

Who is online

Users browsing this forum: No registered users and 30 guests