[ic] Item-alternate leaves unnecessary white space SOLVED

SofaKingRotten interchange-users@icdevgroup.org
Mon Mar 31 20:42:02 2003


Thank you Dan and Josh! I finally got around to trying
this again and I ended up using Josh's code (because I
got it working the fastest). My working code is at the
bottom.

Also to the Author, Mike Heins, thanks for this great
software!

SKR

> Using IC4.8.5 on Redhat 7.2, default db, foundation.
> I'm having trouble finding a solution to this
problem
> using the [item-alternate] tag. I use it on the
> results page to display 4 items per row, like this
> [item-alternate 4]:
>
> Category#1
> X  X  X  X
> X  X  X  X
>
> Category#2
> X  X  X  X
> X  X  X  X
> etc.
>
> However, I have several categories and less than 4
> items in some categories. This causes it to
alternate
> leaving white space, for example, Category#2 starts
> out with item#4, so it alternates, as it should:
>
> Category#1
> X X X
>
> Category#2
> X
> X X X X
> X X
> etc.



<table width="90%" border="0" cellspacing="3"
cellpadding="3">
[search-list]

[item-change 1][condition][item-field
category][/condition]
[perl no_return=1]$tmp_increment=0[/perl]
<tr valign="bottom"> 
<td colspan="4">
    <table border="0" cellspacing="0" cellpadding="0"
bgcolor="CC0000">
      <tr colspan="4">
         <td width="10"><img
src="foundation/minime1.gif" width="10" height="20"
align="top"></td>
         <th width="227"><font __FFACE__
size="1"><b><i><font color="ffffff"
size="2">[either][value banner_text][or][item-field
category][/either]</font></i></b></th>
         <td width="10"><img
src="foundation/minime2.gif" width="10" height="20"
align="top"><br></td>
      </tr>
    </table>
</td>
</tr>
<tr valign="bottom">
[/item-change 1]
<INPUT TYPE=hidden  NAME="mv_order_item" 
VALUE="[item-code]">
<th>
<table border="2" cellspacing="3" cellpadding="7"
bordercolor="CC0000">
<tr><th>
[if file
__DOCROOT____IMAGE_DIR__/thumb/[item-code]_b.jpg]<a
href="[area [item-code]]"><IMG
SRC="thumb/[item-code]_b.jpg" ALT="[item-description]
- Click to enlarge this image" BORDER=0
width="80"></a>[else]<font
size="2">No<br>Image<br>Available</font>[/else][/if]<br>
<font __FFACE__ size="3"
color="#CC0000">[item-price]</font><br><a href="[area
[item-code]]"><b><font __FFACE__
size="1">[item-description]</font></b>[if-item-field
comment]<font __FFACE__ size="1"> - Tell me more about
it! </font><br>[/if-item-field]</a><br>
<font __FFACE__ size="1"
color="#CC0000">[item-code]<font><br><input
type=hidden name="mv_oi[item-increment]"
value=""><input type=text name=mv_order_quantity
size=2 value="">&nbsp;&nbsp;<input type=submit
value="Buy"
onClick="this.form.mv_oi[item-increment].value='[item-code]'"><br>
</th>
</tr>
</table>
</th>
[perl no_return=1]++$tmp_increment[/perl]

[if explicit]
[condition]
    return 1 if $tmp_increment % 4 == 0;
    return 0;
[/condition]</tr><tr valign="bottom"><td
colspan="4"></td></tr><tr valign="bottom">
[else]
[/else]
[/if]
[/search-list]
</tr>
</table>

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com