Hi everyone,
I have a situation where several parent resources which have 30 or more child resources that I do NOT want to be included in the main navigation. In addition, I really can't "Hide From Menus" all these children as they are used by getResources in several other places AND I'm using Hide/Un-hide to turn them off and on in some cases anyway.
What I'd really like is something like: &ignoreChildren=`256,449,895`
Which would tell Wayfinder or getResources to get the children except in where it's told it ignore them.
Does anyone have a suggestion on how to do this with either Wayfinder or getResources?
If I wanted to add this to Wayfinder, would the right place be to modify the function getChildIds in the wayfinder class?
Thanks in advance
Modx = 2.2.8-pl
TinyMCE = 4.3.3-pl
Gallery = 1.5.2-pl
-
☆ A M B ☆
- 24,524 Posts
-
☆ A M B ☆
- 24,524 Posts
Any site_resources field should do the job. For example
&where=`[{"parent:NOT IN": array(256,449,895)}]`
https://rtfm.modx.com/xpdo/2.x/class-reference/xpdoquery/xpdoquery.where
Thanks Susan. It looks good, but for some reason doesn't work. If a child of one of the listed parents isn't hidden from menus, it still shows.
I've added a suggestion in GitHub for &where links and examples to be included in the Wayfinder page.
[ed. note: Gav last edited this post 9 years, 6 months ago.]
-
☆ A M B ☆
- 24,524 Posts
I know that's the syntax for xPDO WHERE clauses, did you try this with just a comma-separated list instead of an array?