hellomoto Posted November 2, 2021 Share Posted November 2, 2021 I tried $homepage->get('misc_site_meta')->where('title=year')->first() but first() isn't applicable and without it nothing. Trying to get value of subfield value_text; tried ->value_text in place of but that didn't work either. It's $homepage->misc_site_meta->first('title=year')->value_text Link to comment Share on other sites More sharing options...
elabx Posted November 3, 2021 Share Posted November 3, 2021 What type of field is misc_site_meta?? Most get methods will return a "non iterable" object so first() is unlikely to work. Ok it's a repeater, you specifically say so in the title lol my pardon! Try: $homepage->misc_site_meta->get('title=year'); This will get you the first repeater item in the misc_site_meta field where title field equals "year". 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