Jump to content

Finding fields in repeater field


kemeris
 Share

Recommended Posts

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

$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

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