[ic] making columns in saved_carts

Paul Jordan interchange-users@interchange.redhat.com
Sun Dec 23 12:37:01 2001


I have converted my saved_carts page to a kind of favorites page. As I am
sure most of you know, this page is mostly perl. With help from the list I
was able to make my results.html page display in 3 columns after some
modification. Well, know I want to display my saved_carts content in
columns.

I have tried several ways, but I think because it is surrounded by perl, my
methods are not working. Like, you can't use ITL in the looped content of
saved_carts. I get the feeling I need to integrate a perl method to make it
display in columns.

I know very little perl. I have tried "adding" perl functions that I thought
would work but it wipes out any display. Can someone please give me a hint.
Do I have to do it within the perl. I have tried every ITL way I can think
of, but it just doesn't work. Where should I be looking in the perl.
--------------------------------
[if cgi delete_cart] [delete_cart nickname="[cgi delete_cart]"] [/if]

[userdb function=get_cart_names hide=1]

[if value carts]
  [perl]
    $Scratch->{saved_carts_carts} = '';
    push(@Vend::TmpScratch,qw/saved_carts_carts/);

    foreach my $var (split("\n",$Tag->value('carts'))) {
        my($name,$last_udate,$type) = split(':',$var);

        my $delink = $Tag->page({
            href => "@@MV_PAGE@@",
            form => "
                delete_cart=$var
                mv_action=return
            ",
        });

my $row = <<"END";
 <TD valign="top">   <table><tr>
<td width="20" valign=top>
  $delink<img src="http://www.imagemogul.com/buttons/delete.gif"
border=0></a>
</td>
<td width="40" align="center"><a class="c2" href="$name"> $name </A></td>
</tr><tr>
<td valign=top colspan="2" align="center"><a href="$name">
<img src="http://www.imagemogul.com/cart/images/thumb/$name.jpg"
border="0"></a>
</td>
</tr>
</table>
  </TD>
END

     if($type eq 'c') {
            $Scratch->{saved_carts_carts} .= $row;
        }
       }

    return '';

  [/perl]
[/if]

[loop list="saved_carts_carts"]
      [if scratch [loop-code]]
    <table width="699" border=0>
     <tr>
       <td><img src="http://www.imagemogul.com/logos/lightbox.gif">
       </td>
     </tr>
      <tr>
       <td class="contentbar1" height="4" width="699"><img
src="http://www.imagemogul.com/elements/clear.gif" height="2"></td>
     </tr>
</table><br>
<table width="699"><tr>[if value carts]
     [scratch [loop-code]][else]You have no images in your light
box.[/else][/if]
</tr></table>
   [else][/else]
  [/if]
[/loop]
-------------------------------------

IC 4.8.1

Thanks again all
Paul Jordan