Jump to content

Find pages with grand children created the last 24 hours


suntrop
 Share

Recommended Posts

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"');
  1. Does children in this context mean only direct children, or any children, grand children etc.?
  2. 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

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...