Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Image Selection for HTML Coding from SSI Script

Does anyone know how to make the img src called using SSI script?

[%GraphicsPath()%] obviously works but I want to use a constructed list to pull 4 semi-random images in for brand evaluation in a droppable freeform item.
asked Nov 10 by Corey1975 (340 points)

1 Answer

+1 vote
You can just create a list where each item in the list is using the image tag as the text.  Then construct a randomized list from that and you can call upon the items from the randomized list to be shown where you want.
answered Nov 10 by Jay Rutherford Gold (21,905 points)
I had tried: <img src=""[% GraphicsPath() %][% ListValue(brandlist, 1) %]

Where the brandlist list had "brand1.png" as the value.

Or should I just use <img src="[% ListValue(brandlist, 1) %]"

Where brandlist are values like "graphics/brand1.png"...
Let's assume you create a parent list called 'Images' with 3 items in the list representing images for brands 1-3 as follows:
1 <img src="[%GraphicsPath()%]brand1.png" alt="" border="0">
2 <img src="[%GraphicsPath()%]brand2.png" alt="" border="0">
3 <img src="[%GraphicsPath()%]brand3.png" alt="" border="0">

Then you could create a constructed list where you want to randomize those images (call it 'RandImages') using the logic:

ADD (Images)
Randomize()

The you could call upon the first image in that list with [% ListLabel(RandImages, 1) %].  That will bring up the first image in your randomized list.  I think that should take you the direction you are looking for, but if not let me know and I can clarify.
...