-
☆ A M B ☆
- 894 Posts
Did you try changing the parent placeholder to another name? It might be that it's confusing it because the syntax is correct AFAIK.
Thanks benmarte, I had tried that already but did so again just to make sure, and no cookie.
It works fine if I remove the placeholder and type the resource id directly in the getResources call but it defeats the purpose of having the call in a chunk in the first place.
Could it be because the &parents=`` parameter is already a snippet parameter and I'm trying to turn it into a chunk parameter? so I'm passing a chunk parameter into a snippet parameter.
Anyways, I'm probably better off just calling getResources directly in the resource instead of adding the extra chunk.
What I wanted to avoid was having to change the call in 100 different pages if I ever decided to modify my getResource call or add a parameter, etc.
do you need getResources uncached, for some reason?
If not, try it cached:
[[getResources? &parents=`[[+parent]]` &tpl=`list-docs-thumb-tpl` &limit=`100` &sortdir=`ASC`]]
or try to call the chunk also uncached:
[[!$gr_chunk? &parent=`12`]]
Thanks Bruno17, I had no idea we could uncache chunks, (good to know), I gave it a whirl and still nothing.
Anyhow, I take it that it's possible then, if you guys are saying that the syntax is correct. So it's probably me or something else conflicting with the call. I'm working with w3c valid code, so I can rule out html errors.
I'll keep working other aspects of the site to clear my mind and get back to this later, if I figure out what I did wrong, I'll post it here.
Thanks again.
Try changing 'parent' to 'my_parent' in both places. That will make sure it's not colliding with another use of 'parent' in the $scriptProperties array.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Thanks BobRay, I did that again and went through a lot of names (always clearing cache in between), but it must be something else, so I just hardcoded the resource in the call and went on with my life, it's a very simple site anyways, so it wasn't worth jumping too many hoops.
Thanks anyways for the great help, at least I know it's possible (for future application) and learned something in the process.
If you get curious, it often helps to look at the cached versions of the various objects (resource, chunk, snippet) in the core/cache directory.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Great tip thanks Bob, I will.