Image from Multi record
I have got a multi record displaying text and images, on the list page I have got the records displaying with text and an image which is fine but I want to show the first image from the first record separately, so I have the list on the left with small images and text then I want the first image form the first record on the right, at the moment it is showing the image from the second record, not the first. What am I doing wrong?
When you get an array of records with their uploads, your first record in the array is $records and the second will be $records etc.. You can get specific record this way and put wherever you like on the page.
Hope that helps and let me know if you have any questions!
If you just want to get the first upload of the record, $record['summary_image'] is what you need instead of a foreach loop. If this code snippet is for displaying the rest images then the if statement should be if($index < 1).
Do you have a screenshot or example of what you want to accomplish so I can get a better understanding of the question?
Hi, this is still not working so I have reverted the code to what I had without your fix in place, I have attached the page code and the link to view the example is below, the image should be the main image from the top story not the bottom story as it is now.
According to your file, the first record of $latest_newsRecords is $latest_newsRecords. After finishing the first foreach loop your $record variable will contain the last element of $latest_newsRecords. So just use $latest_newsRecords['single_image'] should give you the first upload of the first record in $latest_newsRecords.
Sorry I still cannot get this to work, I need only one image to show on the page, so ONLY the image from the first record in a different DIV.
Did you try using $latest_newsRecords['single_image']? If so what is the error that you are having?
Yes I did, I don't get an error it just doesn't work. Is there anyway you can try it and send me the code, the trouble is I want the image to be in a different area as you can see from the code I sent.