Webmastersite.net
Register Log In

Confused about looping in search.tpl

Title Confused about looping in search.tpl
Message Text I am currently having problems with the search.tpl template. I have 3 link types set up: sponsored, reciprocal, and regular. I also want them to be displayed in that order. So in the template, I have created code specific to each link type. The ordering part seems to be working well. What I don't understand is why extra <tr> tags are being generated. For example, the sponsored section of starts like this in my search.tpl template:
<!-- BEGIN SEARCH links RESULTS -->
<table><tr>
<!-- BEGIN SPONSORED -->
<td>
But what gets output in HTML is this (note the two extra opening <tr> tags):
<!-- BEGIN SEARCH links RESULTS -->
<table><tr>
<tr><tr><!-- BEGIN SPONSORED -->
<td>
The next section, for reciprocal links, starts out okay but then looks goofy at the end. The end of the section looks like this in the template:
</td>
<!-- END RECIP -->
</tr></table>
But this is what gets output as HTML (note the extra closing and opening <tr> tags):
</td>
</tr><tr><!-- END RECIP -->
</tr></table>
-------------------------------------------------------------------------- UPDATE: I've done some more testing and discovered that if I set "Separate sponsored links from other types and don't count towards per page total?" to NO, then I don't have the problem of extra <tr> tags at the start of the sponsored section. Now what I have are the extra tags as described just above in the reciprocal section. That happens in all 3 sections: sponsored, reciprocal, and regular. At least it's technically valid HTML so I can probably live with it.
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership flyingpylon
Views 332 views. Averaging 0 views per day.
Similar Topics
Submission Date Feb 09, 2006 - 1:13 PM