Jump to content

Child Thumbnails


Ollie
 Share

Recommended Posts

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

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

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