-
☆ A M B ☆
- 318 Posts
No worries -- I didn't mean that snippets in general are a simple subject, just that this one is pretty short as snippets go.
The way you would use my snippet would be to call it in your template. So just use a normal getResourcesTag call with a template called blogPost like you have in the first post. Put the code in the second code block of my post above in the blogPost template. Then put whatever code you want to actually use for your templates in chunks called template-for-parent-1 etc. (or whatever you want to call them).
You don't have to worry about properties or anything like that. When you call a snippet, whatever parameters you specify in the call are passed into the snippet. So just take the code in my first block above, create a new snippet called valueToChunk, and paste the code into it. You don't have to do anything else, the snippet should just work as-is.
Edit: at first I thought your approach would work, but the problem is that you're using a TV in the getResourcesTag call, which appears on the homepage, right? So even if you use the correct syntax for the TV, it will just take the template value from the value of that TV for the homepage, so that won't work.
[ed. note: esnyder last edited this post 14 years, 10 months ago.]
-
☆ A M B ☆
- 318 Posts
I'm sorry, maybe I'm overcomplicating this -- you may have been better off without my "help."
You're right that it should have only the valueToChunk call.
I'm going to test this and get back to you. Maybe I'm skipping a crucial step or something.
-
☆ A M B ☆
- 318 Posts
OK, I figured out what the problem is -- my snippet is too simple, it doesn't pass the values of the current resource into the chunk.
I have a fix that works without TVs -- with TVs it gets a bit more complicated. I'm working on that, I should have it for you in a few minutes.
I'm glad this came up, actually, as this new snippet will be much more useful to me as well.