[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] results page
****** message to minivend-users from "Bill Randle" <billr@exgate.tek.com> ******
I didn't remember about [loop-alternate] in MV4, and just wrote this
snippet of code this morning before seeing all the messages in this
thread. So, here's another version contributed for the archives.
This displays the results of a search in an array of 4xN thumbnail
images with a title above and photo number below. You click on
the thumbnail image to get a detail page with the full sized-image.
(The value of N is set by the "ml=" search parameter: N = ml/4.)
-Bill
[search-region more=1 search="
ml=12
<other search vars>
"]
<TABLE (your favorite table options here)>
<TR>
<TD COLSPAN="4"><B>Browse Images</B></TD>
</TR>
[set name=data interpolate=1]
[search-list][item-code]|[item-field title]|[item-field image]
[/search-list][/set]
[mvasp global=1]
<%
no strict;
my $colnr = 0;
my @items = grep /\S/, split /\n/, $Scratch->{data};
for(@items) {
my($code, $title, $image) = split /\|/, $_;
if (! $colnr) {
HTML("<TR>");
$colnr++;
}
if ($colnr <= 4) {
my $link = $Tag->area('detail', $code);
HTML(<<EOF);
<TD WIDTH="120">$title<BR>
<A HREF="$link"><IMG SRC="$image" BORDER="0"></A><BR>
<FONT SIZE="-1">Photo No: $code</FONT></TD>
EOF
$colnr++;
}
if ($colnr == 5) {
HTML("</TR>");
$colnr = 0;
}
}
if ($colnr) {
HTML("</TR>");
}
%>
[/mvasp]
</TABLE>
[more-list]
<BLOCKQUOTE>
<B><FONT COLOR="navy">More pages:</FONT></B>
<BR>[more]<BR>
</BLOCKQUOTE>
[/more-list]
[/search-region]
On Jun 11, 1:46pm, Cameron B. Prince wrote:
} Subject: RE: [mv] results page
} ****** message to minivend-users from "Cameron B. Prince"
<cbp@InternetExpertsLLC.com> ******
}
} Great snip of code there Ed.
}
} I had wondered about doing this as well...
}
} Cameron
}
} -----Original Message-----
} From: owner-minivend-users@minivend.com
} [mailto:owner-minivend-users@minivend.com]On Behalf Of Ed LaFrance
} Sent: Sunday, June 11, 2000 12:33 PM
} To: minivend-users@minivend.com
} Subject: Re: [mv] results page
}
}
} ****** message to minivend-users from Ed LaFrance <edl@newmediaems.com>
} ******
}
} Andreas -
}
} This code will do it for a two-column format, it will also close the table
} row properly if you have an odd number of results. In the application it
} was designed for it would sometimes skip results, so I used the scratch
} variable colcount to keep track of where I was in the item list, along with
} some condition logic which I have deleted here. You could probably remove
} the 2nd and third line and just use [item-increment] wherever you see
} [scratch colcount] thereafter.
}
} - Ed L.
}
} ----------------->
} <table width=100% border=0 cellpadding=4 cellspacing=0 bgcolor=#ffffff>
} <tr><td colspan=4 class=tiny>
} <!-- the two columns are actually four - two pairs of two columns each,
} the second one can easily be removed, make colspan=2 above, then see
} below -->
} </td></tr>
} [search-list]
} [set colcount][/set]
} [set name=colcount interpolate=1][calc][scratch colcount] + 1[/calc][/set]
} [perl interpolate=1]
} $a = [scratch colcount] % 2;
} if ($a){"<tr>"}else{""};
} [/perl]
} <td> <font color=black style="font-size:
} 12pt"><b>[item-code]</b></font><br>
} <font color=black>[item-description]</font>
} </td>
} <td><!-- you can take out this TD pair unless you want to use it -->
} another column
} </td>
} [perl interpolate=1]
} $a = [scratch colcount] % 2;
} if (!$a){"</tr>"}else{""};
} [/perl]
} [if type=value term=mv_search_match_count op="=="
} compare="[item-increment]"]
} [perl interpolate=1]
} $a = [scratch colcount] % 2;
} # take "colspan=2" out of the td tag below if you removed
} the 2nd column above
} if ($a){"<td colspan=2> </td></tr>"}else{""};
} [/perl]
} [/if]
} [/search-list]
} </table>
}
}
}
} At 06:22 PM 6/11/00 +0200, you wrote:
} >****** message to minivend-users from Andreas Kotowicz
} ><koto@mynetix.de> ******
} >
} >hi,
} >
} >I have a problem generating a results page. usually you take some <tr> tags
} >into a loop and then everything will be automatically generated like this:
} >
} >item1
} >item2
} >..
} >itemX
} >
} >but now I thougt about results being displayed like that:
} >
} >item1 item2
} >item3 item4
} >...
} >itemX-1 itemX
} >
} >
} >I really don't know how to generate the code. you need one loop for
} creating
} >new fields, and an other one the items. but how? anyone a hint?
} >
} >
} >andreas
} >-
} >To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
} >email with 'UNSUBSCRIBE minivend-users' in the body to
} Majordomo@minivend.com.
} >Archive of past messages: http://www.minivend.com/minivend/minivend-list
}
} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} | New Media E.M.S. Software Solutions for Business |
} | 12831 Blanco Ct. Consulting |
} | Poway, CA 92064 U.S.A. Custom Programming |
} | 858-486-6508 Internet and eCommerce |
} | 630-604-4265 eFax |
} | edl@newmediaems.com |
} | http://www.newmediaems.com |
} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
} -
} To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
} email with 'UNSUBSCRIBE minivend-users' in the body to
} Majordomo@minivend.com.
} Archive of past messages: http://www.minivend.com/minivend/minivend-list
}
} -
} To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
} email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
} Archive of past messages: http://www.minivend.com/minivend/minivend-list
}-- End of excerpt from Cameron B. Prince
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list