Jump to content

Searching repeater and trashed items included


digitex
 Share

Recommended Posts

What is the reason for include=all in a selector to include trashed pages? One would assume a page in the trash would be one you wouldn't want found.

I have a search that searches a repeater and the selector includes the repeater template and include=all because otherwise nothing gets returned. The problem is that when a page containing the repeater is in the trash it also gets returned in the results which is undesirable.

The site in question has members, the members have pages with repeater and members either renew membership or not. If not they go into the trash but not deleted because often a month or so down the road they change their minds, renew and it's easier to drag their page out of trash than start over.

I've tried filtering results to remove trashed pages and excluding pages if their status is trash and excluding pages with trash as parent etc. but nothing works.

Is there a standard way to search a repeater without including trashed pages?

Link to comment
Share on other sites

This is untested, but if you add this to your selector, it should exclude pages in the trash:

has_parent!=7

Thanks adrian. Oddly, that doesn't do anything. I logged out to make sure the results weren't appearing because I was viewing the page as a superuser. But no effect. When you click on the link in the results it takes you to the login. Not good.

Link to comment
Share on other sites

It's the same as 

"status<" . Page::statusTrash . ", sort=bla"

Or 

"status<" . Page::statusUnpublished . ", sort=bla"

Edit: edited

As it has to be smaller than trash or unpublished, since include=all will also return unpublished pages.

Link to comment
Share on other sites

Trash has id 7 so this should work. Do you have any other has_parent in your selector?

Nope. The repeater template, a couple of input values as a date range and include=all. I am not on the latest release though. it's 2.2.9 and upgrading would be a bit of work due to a custom login page but if that's the problem I'll upgrade ASAP.

It's the same as 

"status<" . Page::statusTrash . ", sort=bla"

Or 

"status<" . Page::statusUnpublished . ", sort=bla"

Edit: edited

As it has to be smaller than trash or unpublished, since include=all will also return unpublished pages.

I tried this as well, I found it in a search of the forum, don't remember what thread now but it had the effect of rendering no results. weird.

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...