Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to get the PublishingRollupImage of a list item using the server object model (requirement) in a sandbox solution. The problem I have is that I can't reference the Microsoft.SharePoint.Publishing assembly required for ImageFieldValue

This is how I would do it with a farm solution

foreach (SPListItem item in listItems)
{
 bannerImages.Add(new BannerImage
 {
  Title = Convert.ToString(item[SPBuiltInFieldId.Title]),
  Subtitle = Convert.ToString(item["Subtitle"]),
  RollupImage = ((ImageFieldValue)(item["PublishingRollupImage"])).ImageUrl,
  Link = Convert.ToString(item["Link"]),
 });
}

but if I try to activate it as a sandbox solution I get an error saying that I can't include a reference to the DLL mentioned above

How would I go about getting the URL of the image without using ImageFieldValue? It would be hosted in Office365 so can't change any web.config or write custom CAS etc.

Edit: it's SharePoint 2013.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.