kemeris Posted July 27, 2016 Share Posted July 27, 2016 Hi everyone, I am beginner with PW. I have page with repeater field "section_repeat" which contain two fields "section_title" and "section_body". How I want to find record in "section_repeat" where "section_title" value is "Section 1" in page template. I am trying something like this with out success $field = $page->fields->find("section_repeat.section_title=Section 1"); Thanks in advance Link to comment Share on other sites More sharing options...
Tom. Posted July 27, 2016 Share Posted July 27, 2016 Try: $field = $page->fields->find("section_repeat.section_title='Section 1'"); Link to comment Share on other sites More sharing options...
LostKobrakai Posted July 27, 2016 Share Posted July 27, 2016 $page->fields is returning a list of field definitions, but not the data stored in those fields of the page. You want to search the section_repeat's data array like this. $page->section_repeat->find("section_title=Section 1"); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now