You could try something like this...   First, create a function that 
will process the data values.  Then, assign that function to the 
ex:href-subcontent.    This also works for facets.

Exhibit.FunctionUtilities.registerSimpleMappingFunction(
    "myFunction",
    function(val) {
if (val == "foo") { 
  return "../folder1/" + val;
} else if (val == "foo2") {
  return "../folder2/" + val";
}
},
    "text"
); 


ex:href-subcontent="myFunction(.scriptURI)"   or 
ex:href-subcontent="myFunction({{value}})"


You could probably also pass in multiple values to create your path 
information, something like 
ex:href-subcontent="myFunction(.scriptURI, .data2)"



Not quite an elegant solution but it seems like it should work in your case.

- John 




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
-~----------~----~----~----~------~----~------~--~---

Reply via email to