Jump to content

[solved] $page->find does not work


Recommended Posts


I have a strange problem with $page->find
The problem is that it's not work for a particular template. I correctly get the starting $page but these kind of selectors don't work 


but these work


I tried also with include=all in the selector.

The strage thing is that I repeat the same procedure with another starting parent $page the system works perfectly.

Any ideas?

Link to comment
Share on other sites

Just checking: you know for certain that you have published, unhidden pages that use template "my-template" as descendants of $page (i.e. you can see them in the page tree) but they are not returned with either:

$results = $page->find("template=my-template");


$results = $pages->find("has_parent=$page, template=my-template");

(both of these are effectively the same thing)

If that's the case it's possible that something has gotten messed up in the pages_parents database table. In PW 3.0.156 or newer you can rebuild the pages_parents table by executing the following in the Tracy console or in a template file:


See method PagesParents::rebuildAll()

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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

  • Recently Browsing   0 members

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