Are &parents and &resources mutually exclusive?
On the attached tree if I run from resource 8 the following
[[!getResources? &parents=`3` &resources=`4` &tpl=`gallery`]]
it returns resources 4 and 6 and therefore ignores my parameter &resources=`4`
However if I change it to
[[!getResources? &parents=`1` &resources=`4` &tpl=`gallery`]]
it correctly returns just resource 4
Should I report this as a defect or is it a misunderstanding?
Thanks
Mark
I think &parents just shows the children of the named resource. Resource 1 has no children, so none are shown.
It would be nice if getResources had a &showStart parameter that would make it show the parent itself as well.
Actually that’s the opposite of what I was saying?
Starting from &parents=`1` seemed to start it from the root of the site. (which I’m happy about)
My point was that starting from a child e.g. &parents=`3` &resources=`4` seemed to confuse the query.
Sparkyhd - your initial conditions are not exclusive - in pseudo code - ’show children of resource 3 and include resource 4’. As 6 is also a child of resource 3, gR returns it.
When you change it to &parents=1, then you get all the children of resource 1 (ie none), plus the resource you asked to be included regardless.
If you want to specifically disregard 6, then you need to do &resources=`4,-6`.
Or at least that is my understanding. It’s tempting to think of &resources to be a subset of &parents, but it isn’t (again, as far as I can tell through usage).
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
Ok thanks - I misunderstood it.
I thought &resources=`4` meant LIMIT to 4
rather than
include as well as anything else found under the parent.
Thanks for putting me straight.
Evolution user, I like the back-end speed and simplicity
