suntrop Posted November 18, 2018 Posted November 18, 2018 I want to find pages, which have sub sub pages created the last 24 hours. Those two selectors don't work … I guess, because I am looking for grand (grand) children, not direct children. $ps = wire('pages')->find('template=board, children=[created>="24 hours ago"]'); $ps = wire('pages')->find('template=board, children.created>="24 hours ago"'); Does children in this context mean only direct children, or any children, grand children etc.? Any idea how to get my pages? Home - BOARD A - - Cat 1 - - - Page (created 96 hours ago) - BOARD B - - Cat 1 - - Cat 2 - - - Page (created 12 hours ago) - - - Page - - Cat 2 - BOARD C - - Cat - - Cat - - - Page - - - - Page (created 5 hours ago) - - - Page Need to find BOARD B and BOARD C
Zeka Posted November 18, 2018 Posted November 18, 2018 Hi @suntrop pages('template=board, children.children.created>="-24 hours"'); It works for me. 5
suntrop Posted November 18, 2018 Author Posted November 18, 2018 Ha ? didn't know this is possible. Have this working now with $ps = wire('pages')->find('template=board, (children.children.created>="24 hours ago"), (children.children.children.created>="24 hours ago"), (children.children.children.children.created>="24 hours ago")'); … perhaps I wasn't clear enough, I need some levels more. Anyhow, the above will work for me. Thanks Zeka!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now