Jump to content

Search Selector (pageTable.repeater.field)


Orkun
 Share

Recommended Posts

How can I query pages from a pagetable which has a repeater, and this repeater has a title or body field. It's like a sub - sub - selector. At the moment I am trying this:

$selector = "title|body|headline|link|linktext|introheadline|body2|content.body|content.body2|homeSections.title|homeSections.headline|homeSections.body|newsSections.news.title|newsSections.news.body|slider.body|team.body~=$q, limit=50, template!=news";

But "newsSections.news.title|newsSections.news.body" doesn't work (expected that). I need it because of my News Overview Page which has a newsSections PageTable Field for creating News Year Pages.

The PageTable has a repeater where I can create the specific News for the corresponding News Year Page. I want to query the Title and Body field of the News Items.

Link to comment
Share on other sites

Thank you, this worked for me:

$q = $sanitizer->selectorValue($q); 

$selector = "(title|body|headline|link|linktext|introheadline|body2|content.body|content.body2|homeSections.title|homeSections.headline|homeSections.body|slider.body|team.body~=$q), (newsSections=[news.title|news.body~=$q]), limit=50, template!=news";

$matches = $pages->find($selector); 

 

Link to comment
Share on other sites

I see you're using a limit, therefore I assume you're using pagination, where this one won't work. Use OR-groups to put both searches into a single selector, if you need pagination to work. If you need more control over the sorting of results take a look at this topic: 

 

  • 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

  • Recently Browsing   0 members

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