Ollie Posted July 13, 2013 Share Posted July 13, 2013 Hi Everyone, I have looked all over these forums for an answer to no avail! I am very new to all this so please bear with me, I have a portfolio page that is showing all of that pages children almost perfectly but it will not show the thumbnail. Here is the code, I know i need to specify the selector but i cant figure out how? <?php foreach($page->children as $child) echo "<li class='{$child->cat}'><a href='{$child->url}'><span>{$child->thumbnail_summary}</span><img src='{$child->url}'><div class='thumb-t'><h3>{$child->title}</h3></div></a></li>"; ?> Thanks! Link to comment Share on other sites More sharing options...
diogo Posted July 13, 2013 Share Posted July 13, 2013 on the image src you have the child url, when what you should have is the thumbnail url. 1 Link to comment Share on other sites More sharing options...
Pete Posted July 13, 2013 Share Posted July 13, 2013 Exactly what diogo said. So if your thumbnail image field is called "thumbnail" then replace the img src with $child->thumbnail->url (or if it hasn't been specifically set to only allow one image to be uploaded to that field it might be $child->thumbnail->first()->url if the field is set to allow multiple images). 1 Link to comment Share on other sites More sharing options...
diogo Posted July 13, 2013 Share Posted July 13, 2013 I was on mobile, so the answer was a bit dry. Thanks for completing it Pete. And welcome to the forum Ollie 1 Link to comment Share on other sites More sharing options...
Ollie Posted July 13, 2013 Author Share Posted July 13, 2013 Thanks a load guys! I did try this earlyer but i was putting in the wrong selector :s 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