PDA

View Full Version : Generating image links from record


graficus
09-05-2006, 05:18 PM
Sum: generate links based on record values.

Detail:

There is a column 'options' that contains inline values "1B,4,16" for example and is displayed in a dropdown (commas automatically separate list values). These values differ from one record to another.

What I need to do is look up those 'options' values and display a list of JPEGs adding "images/color_swatches/<%optionValueHere%>.jpg" resulting in

"images/color_swatches/1B.jpg" &nbsp; "images/color_swatches/4.jpg"

and so on, so that only jpegs corresponding to available listed options are shown.

Any solutions are very much appreciated.


PS: This is a workaround for existing shopping cart (VP-ASP 6), where inbuilt 'features' feature does not suffice.

graficus
09-06-2006, 08:24 AM
Got this to kind of work. How do I insert line break every 4 records?


<%
Dim MyString, MyArray
MyString = "1,2,3,4,5,6" 'dynamic on real site
MyArray = Split(MyString,",")
For i=0 to UBound(MyArray)
response.write "<img src=images/thumbs/" & myArray(i) & ".jpg>&nbsp;"
Next
%>

Spudhead
09-06-2006, 03:37 PM
For i=0 to UBound(MyArray)
If i mod 4 = 0 then response.write("<br/>")
response.write "<img src=images/thumbs/" & myArray(i) & ".jpg>&nbsp;"
Next