-
☆ A M B ☆
- 24,524 Posts
-
☆ A M B ☆
- 3,141 Posts
This should work just fine:
[[MySnippet? &color=`[[*BGColor]]`]]
What happens when you output just the TV value?
-
☆ A M B ☆
- 24,524 Posts
Sorry, I didn't see that clearly and thought it was in snippet code.
I now realize the issue is that the code is in a chunk template for a Getresource. The code works fine outside of the getresource, but how do we pass the TV for all resources listed in the getresource? Thanks for the help and in the mean time I will see of any of the linked pages help.
inside a getResources - tpl you would do:
[[MySnippet? &color=`[[+tv.BGColor]]`]]
don't forget to add
to your getResources-call
[ed. note: Bruno17 last edited this post 11 years, 4 months ago.]
-
☆ A M B ☆
- 24,524 Posts
Bruno, wouldn't that be
[[MySnippet? &color=`[[+tv.BGColor]]`]]
Of course. Seems you have better eyes, than me, this morning.
Corrected.
-
☆ A M B ☆
- 24,524 Posts
The issue here is to understand the difference between a resource/TV tag [[*...]] and a placeholder tag [[+...]]
When you have a getResources (or any other snippet that sets placeholders to use in an output tpl) it sets a temporary placeholder to use in the tpl as it gets applied to each resource in its list. As it loops through the list, the placeholders will change for each item to hold the values from that resource that getResources is working on.
You have the resource that the getResources tag is called in, the current resource. The resource or TV tag [[*...]] will always hold the value from that current resource, always. So if, in your chunk tpl, you use the [[*...]] tag it will refer to the value for the current resource, not the resource that getResources is working on as part of its list. If you are using a TV, if the current resource doesn't have that TV or doesn't have a value in it, then [[*myTV]] will have nothing for every item in the list. If it does have a value, then that same value will be repeated for every item in the list.
Thanks all for the help again. I would have bet my life I did it with "+tv." but must have typed something wrong because it wasn't working.