Webmastersite.net
Register Log In

Confused about looping in search.tpl

Comments on Confused about looping in search.tpl

flyingpylon
Member

Usergroup: Customer
Joined: Dec 12, 2005

Total Topics: 11
Total Comments: 19
Posted Feb 09, 2006 - 3:13 PM:

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.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 10, 2006 - 11:59 PM:

Fixed for 3.3.7. Note: involves taking the <tr> and </tr> out of the template.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.