On Nov 8, 3:28 pm, Ava <[email protected]> wrote:
> My dataset like this:

[snipped...]

> I wanna display all the images in imgURL,
> <div ex:role="lens" style="display: none;">
>             <img ex:src-content=".imgURL" />
> </div>
>
> but this only show only one image with the first imgURL in "[ ]", any
> idea to show them all? Thanks a lot!

When an array is passed to ex:content, Exhibit looks to see if the
element has any child elements (inner HTML markup).  If it does the
inner HTML is treated as a sub-lens and repeated for each value in the
array.  If it does not, Exhibit creates a printable string from the
array values in the form "value1, value2, value3 ... and valueN".

The problem is your array values are being turned into a single
string, then added to a single <img> -- you want instead to create a
sub lens for each value in the array.

<div ex:role="lens" style="display: none;">
        <span ex:content=".imgURL" >
            <img ex:src-content="value" />
        </span>
</div>

The HTML inside the <span> is a sub lens, and will be repeated
separately for each value in the .imgURL array.  The special keywords
"index" and "value" (note no dot prefix) can be used to get the
current index and value with each repetition of the sub lens.


SEM

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

Reply via email to