Okay, this is really getting to me. I want to call up one resource by its id and I can’t work it out.
Logically I thought this would work:
[[getResources? &parents=`5` &resources=`265` &tpl=`template_links` &includeContent=`1` &includeTVs=`1` &limit=`1`]]
However, it bring up the most recent resource in 5.
So I thought I would try this:
[[getResources? &parents=`5` &resources=`265` &tpl=`template_links` &includeContent=`1` &includeTVs=`1` &where=’{"id:=":265}’ &limit=`1`]]
By adding the &where call, but it still brings up the most recent resource in 5.
I thought, like in Ditto I could retrieve a specific resource by its id, however, it appears not.
Any ideas?
-
MODX Staff
- 10,725 Posts
Set &parents=`-1` — you are including all children of the current Resource (plus your specific Resource specified in &resources) by not specifying a &parents value.
Thanks Jason, the &parents=`-1` worked fine. Definitely put it into the documentation, as there is nothing there about this and I would think it would be a common occurrence.