I have a number of owner nodes - these have an Ultimate Picker which selects regions. I have a a search page into which I pass a region. I want to spit out a list of all owners that have this area/region selected in the picker.
I have seen other code examples using Contains but isn't there is a potential problem in this solution?!?..
You're right about the potential for contains() to be a bit too quick to match. There's a way around that, though.
Keep in mind that you'll have commas between multiple items, so.... add a comma to both ends of the values returned by the ultimate picker so that you'll end up with a variable with ",1111,2222,". You can do this with the concat() function.
[code][/code]
(btw, it is best NOT to have spaces in your alias names... it just makes everything less error-prone)
Once you've got your variable with commas everywhere, you can use the contains() test, and put commas on both sides of what you're looking for.
[code][/code]
As to your comment that your xslt macro is getting longer than you'd like... welcome to xslt! It must be the world's most verbose language. Even the classic "Hello, World!" can take a dozen lines.
I'm trying to use this technique with GetXmlNodeById() where I'm passing in the source via Macro param. How would I go about getting the hosting page's id (like the ',111,' listed above) with that approach?
Checking Ultimate Picker Values
I feel like I'm missing something obvious here...
I have a number of owner nodes - these have an Ultimate Picker which selects regions. I have a a search page into which I pass a region. I want to spit out a list of all owners that have this area/region selected in the picker.
I have seen other code examples using Contains but isn't there is a potential problem in this solution?!?..
[/code]
You're right about the potential for contains() to be a bit too quick to match. There's a way around that, though.
Keep in mind that you'll have commas between multiple items, so.... add a comma to both ends of the values returned by the ultimate picker so that you'll end up with a variable with ",1111,2222,". You can do this with the concat() function.
[code][/code]
(btw, it is best NOT to have spaces in your alias names... it just makes everything less error-prone)
Once you've got your variable with commas everywhere, you can use the contains() test, and put commas on both sides of what you're looking for.
[code][/code]
As to your comment that your xslt macro is getting longer than you'd like... welcome to xslt! It must be the world's most verbose language. Even the classic "Hello, World!" can take a dozen lines.
Hope this helps.
cheers,
doug.
Hi Douglass,
I'm trying to use this technique with GetXmlNodeById() where I'm passing in the source via Macro param. How would I go about getting the hosting page's id (like the ',111,' listed above) with that approach?
Let me know if I need to be more clear.
Thanks,
Nathan
s--; (sorry about that)
I figured this out. I just set a variable to the currentPage so that I can use it within the for-each loop.
-N
is working on a reply...