Jump to content

a search problem with repeater


leoric
 Share

Recommended Posts

i have a repeater field  named 'q_items'.

the repeater 'q_items' have a PageArray field named 'products'.

and now i want search by products field's title.

//category A ---------------------------------------------------------------------

Page A:

----title

----q_items

--------products = PageD  (the page's title contain 'processwire',PageA will be show in the search result)

Page B:

----title

----q_items

--------products = PageE 

Page C:

----title

----q_items

--------products = PageF  (the page's title contain 'processwire',PageC will be show in the search result)

//category B ----------------------------------------------------------------

Page D

----title = "i love processwire"

----body

Page E

----title= "i love this world"

----body

Page F

----title= "hello,processwire"

----body

in the sample data, when i search 'processwire' and  will get PageA and PageC

this is an error expression:

$matches=$pages->find(q_items.products.title%=processwire)

is it possible to do this?

 
Link to comment
Share on other sites

I may be wrong, but I don't think that sub-sub-selectors are possible.

You'd have to loop through your repeater pages and collect the products where the title matches.

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