How to retrieve image properties from multiple images uploaded via media picker
I can display all the images nicely, using a partial view macro which displays the images beautifully, but I have added a 'link' property to the image settings so the team user can specify where they want the image linked to, and I then need to be able to pull this out for each image in order to surround the @hpItem.Url (src ref) and make each image clickable to direct to another page. I hope that is clear. This would be so easy in .NET! something like @hpItem.link ? or is that too obvious (it doesn't work anyway).
Currently I have the code (which displays perfectly):
thanks Nigel, I thought I had already tried that, but apparently not. I knew it would be something that simple. Obviously my next step is to swat up on Razor coding! Much appreciated!
How to retrieve image properties from multiple images uploaded via media picker
I can display all the images nicely, using a partial view macro which displays the images beautifully, but I have added a 'link' property to the image settings so the team user can specify where they want the image linked to, and I then need to be able to pull this out for each image in order to surround the @hpItem.Url (src ref) and make each image clickable to direct to another page. I hope that is clear. This would be so easy in .NET! something like @hpItem.link ? or is that too obvious (it doesn't work anyway).
Currently I have the code (which displays perfectly):
@if (CurrentPage.HasValue("rptImg")) { var rptImgImagesList = CurrentPage.rptImg.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var rptImgImagesCollection = Umbraco.Media(rptImgImagesList); foreach (var hpItem in rptImgImagesCollection) {
}
Hi Karen
Untested, but I think the following should give you the value:
Hope this helps
Cheers, Nigel
thanks Nigel, I thought I had already tried that, but apparently not. I knew it would be something that simple. Obviously my next step is to swat up on Razor coding! Much appreciated!
is working on a reply...