Sorry, I'm really busy right now and don't have time to code out the entire template but here is what you need to do.
Only output the starting <td width="246"> when you are in the
[-- IF SEARCHPRODUCT --] section and not right after the
[-- LOOP SEARCH 8 --]
Then you need to keep track of the fact that the <td> is open and only close it when you start the next [-- IF SEARCHPRODUCT --] or when you have exited the routine at [-- END_LOOP SEARCH --]
so something like
before you start the [-- LOOP SEARCH 8 --] you need to set a VAR to keep track of the state of the <td>
- Code: Select all
[-- VAR.TDState closed --]
...
[-- LOOP SEARCH 8 --]
[-- IF SEARCHPRODUCT --]
[-- if VAR.TDtate open --]
</td>
[-- VAR.TDState closed --]
[-- end_if --]
<td width="246">
[-- VAR.TDState open --]
[-- SEARCHRESULT --]
[-- END_IF --]
Then you do your intervening code that you have (I have no idea what you are trying to do there) and you close that section with
- Code: Select all
[-- IF SEARCHLINK --]
[-- SEARCHRESULT --]
[-- END_IF --]
[-- END_LOOP SEARCH --]
[-- IF VAR.TDState open --]
</td>
[-- VAR.TDState closed --]
[-- END_IF --]
</tr>
Note that I have not actually run the above code so you may need to do some modification to it. You can look at some of the shopsite search templates that allow columns and see how they are done but they may be more complicated than this.