taotoo Posted July 25, 2022 Share Posted July 25, 2022 I want to display some images. Sometimes the images will be from the current page's image field. But sometimes they will instead be from the image fields of multiple items in a page reference field. I presume in the first case I'm getting an array of images, but for the second I'm getting something else (junk maybe)? // Get images of the author if they exist if $page->images !='': $source = $page->images; // Otherwise get images of their book covers else: $source = $page->page_ref_for_their_books->images->first; endif; foreach $source as $source: echo $source->size(100,100)->url; endforeach; Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now