Jump to content

Excluding repeaters from $pages->find()


Mike Rockett
 Share

Recommended Posts

Greetings :)

I'm new to PW, and think it's fantastic! Never, ever, have I seen such an amazing CMF!

Anyways, to my question: I had set some Hanna Code to render a list of page suggestions on the http404 page, which works perfectly. The problem, however, comes in when I use repeaters, which are page instances.

The page suggestion renderer has the following:

    $suggestions = $pages->find('name|title|summary|body%='.$request);

I have a page that is named services-industries, and repeaters with the word services in the name. As such, repeaters appear in the suggestion results-list if applicable to the search.

How can I exclude/remove those?

Link to comment
Share on other sites

Hi :) No, I don't have any selectors like that.

I thought that since I'm searching for suggestions based on the request (which is the name), that I should also be searching for others by name as well. Nonetheless, if I remove name from the query, I still get the repeaters.

Though, I've just noticed that they only appear when I am logged in. Each repeater contains a link to itself in the backend. But when you click on it, it says that there's no Process for this. This is an example URI: /administration/repeaters/for-field-136/

Anyways, if I'm logged out, it's cool. Perhaps there's a bug, or was it like that intentionally?

Link to comment
Share on other sites

  • 6 months later...

Repeaters are stored in admin with own template not "admin" template, so a logged in superuser see's them but others not.

it's not a bug. You could exclude admin or by template if you want superuser not see them.

has_parent!=2

  • Like 1
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

×
×
  • Create New...