Your mistakes can be somewhere else other than the code snippets that
you're showing us here. Could you either give a URL to your exhibit or
provide much more code so that it's easier for us to try to think what
might have gone wrong? Also, for whatever that you tried, what were the
results? Did everything break? Or did the links just not get formatted
correctly?...
David
kumarachi wrote:
> Hi,
>
> now I need a little more help on this...hope there's a solution.
>
> the Path to the object I need to link to is actually categorized
> according to the label.
>
> so instead of
>
> ex:href-subcontent="../scripts/{{value}}"
>
> I need to be able to link to content that is in different folders,
>
> scripts/<some-name>/{{value}},
>
> where <some-name> changes according to the label on that item.
>
>
> I have, with my limited understanding of expressions in Exhibit, tried
> various things like:
> scripts/{{label}}/{{value}}, scripts/{{.label}}/{{value}} and other
> variations - all in vain.
>
> Can you help me?
>
> thanks
> -k
>
>
>
> On May 18, 6:58 pm, kumarachi <[email protected]> wrote:
>
>> oh my god :-).
>> perfect, David, thanks so much - works exactly as I need it.
>> 1 mins after 3 days of trying variations without fully understanding
>> what I was trying...
>>
>> thank you!!.
>>
>> On May 18, 6:32 pm, David Huynh <[email protected]> wrote:
>>
>>
>>> kumarachi wrote:
>>>
>>>> Hello,
>>>>
>>>> Could someone help me please.
>>>> I am having some trouble creating links from an array in my JSON data.
>>>>
>>>> I have this snippet from my data.js:
>>>> "scriptURI" : [
>>>> "walkthrough.doc",
>>>> "overview.doc",
>>>> "datasheet.docx"
>>>> ],
>>>>
>>>> And in my exhibit file, I want to be able to show these items as href
>>>> links in an Unordered List inside a Lens like this:
>>>> <ul>
>>>> <li><a href="../scripts/walkthrough.doc">walkthrough</a></li>
>>>> <li><a href="../scripts/walkthrough.doc">overview</a></li>
>>>> <li><a href="../scripts/walkthrough.doc">datasheet</a></li>
>>>> </ul>
>>>>
>>>> I am sure this has been done many times elsewhere...
>>>>
>>>> I am looking through the various examples for examples of iteration on
>>>> such fairly simple data - and attempted to use the foreach function,
>>>> but somehow cant get this working. I dont quite understand what the
>>>> correct syntax is...and I am not even sure if using foreach is the
>>>> right approach.
>>>>
>>>> I seem to get them all concatenated together, or in other variations,
>>>> I receive an error about G[1] undefined...What should the second
>>>> parameter here be?
>>>>
>>>> <ul>
>>>> <li><span ex:content="foreach(.scriptURI,???)"></span></li>
>>>> </ul>
>>>>
>>>> Can anyone help me?
>>>>
>>> Kumar,
>>>
>>> Try
>>>
>>> <ul ex:content=".scriptURI">
>>> <li><a ex:href-subcontent="../scripts/{{value}}"
>>> ex:content="value"></a></li>
>>> </ul>
>>>
>>> Elements inside an element with ex:content are used as a template for
>>> rendering each value in the set that the ex:content expression evaluates to.
>>>
>>> David
>>>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---