Reclus Posted January 18, 2018 Share Posted January 18, 2018 Hello. I'm trying to call the results of a child field into its parent page. The field is using the Select Options field with multiple check-boxes. I'm struggling to write workable code, I currently have this (see below) which doesn't work but may help explain what I am hoping to achieve ... thanks in advance. <?php foreach($page->children as $item) { echo '<p>' . $item->tags . '</p>'; } ?> Link to comment Share on other sites More sharing options...
adrian Posted January 18, 2018 Share Posted January 18, 2018 It looks like you never specify the name of the Options field. You probably want: foreach($page->children as $item) { foreach($item->optionsfield as $option) { echo '<p>'.$option.'</p>'; } } 1 Link to comment Share on other sites More sharing options...
Reclus Posted January 18, 2018 Author Share Posted January 18, 2018 Thanks very much Adrian, this has helped a great deal. I now have the code working , I ended up with this ... <?php foreach($page->children as $item) { foreach($item->tags as $item) { echo '<li>' . $item->title . '</li>'; } } ?> 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