picarica Posted July 24, 2021 Share Posted July 24, 2021 so i want to $pages->find find pages only that dont have children i didnt see any options for this so i tried this $kate = $pages->find("template=hry_home"); foreach ($kate as $bruh) { if($bruh->hasChildren()) { $kate->remove($bruh); } } this works incredibly good but i need it for pagination so i still need to limit it and thats where i got stuck simply $kat = $pages->find("$kate ,limit=5"); doesnt work, how do you work around this problem? every page has the same template, so i cannot use just different selector in find command are there any other quirsk i could use ? Link to comment Share on other sites More sharing options...
Zeka Posted July 24, 2021 Share Posted July 24, 2021 Hi @picarica Have you tried something like $pages->find('template=hry_home, children.count=0'); or $pages->find('template=hry_home')->not('children.count=0'); ? Link to comment Share on other sites More sharing options...
picarica Posted July 24, 2021 Author Share Posted July 24, 2021 15 minutes ago, Zeka said: Hi @picarica Have you tried something like $pages->find('template=hry_home, children.count=0'); or $pages->find('template=hry_home')->not('children.count=0'); ? no i wasnt aware of -> not() functinon this works fine i found out one workaround by myself i checked if field which as every page isnt empty but this is very good solution thanks $kat = $pages->find("subor_hry>1, $limiter"); Link to comment Share on other sites More sharing options...
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