Jump to content

Image on repeater field uploads to server but cannot be found via URL


melissa_boyle
 Share

Recommended Posts

Hi Guys,

I am pretty new to process wire and am experimenting with repeater fields. The issue is that the image cannot be found via the URL but im not sure why? Im sure this is something silly however I cannot see the problem. The image is uploading fine via the content management system however when viewing on screen it comes as though the image cannot be found.

All help would be greatly appreciated.

Thanks,

Melissa

 <?php
            foreach($page->about_timeline_left as $about) {
                    $image_left = $about->left_images;
            
                    echo "<div class='ss-row'>
                    <div class='ss-left'>
                    <img src='{$image_left->url}' alt='{$image_left->description}'><a class='ss-circle ss-circle-1 ss-circle-deco'></a></div>
                    <div class='ss-right'>
                    {$about->right_description}
                    </div>
                    </div>";
             }
            ?>
 
Link to comment
Share on other sites

Hi Melissa,

I am guessing it's probably an issue with the the Maximum Files Allowed setting on the details tab of your left_images field settings. You should either set this to "1" or use the following to get the first of the images in that field:

$image_left = $about->left_images->first(); 

If you haven't already, have a read of these:

http://processwire.com/api/fieldtypes/images/

http://processwire.com/api/fieldtypes/repeaters/

EDIT: I saw you lurking over here:

http://processwire.com/talk/topic/2188-solved-repeaters-with-images/

but thought I'd add that link here as well anyway, in case others come across this post first and would like more info.

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

×
×
  • Create New...