We\'re using the Sharepoint 2013 REST API to get all news items from the Sharepoint. We made a custom ContentType \'Newsitem\' with several properties including a Publishing Ima
function LoadArticle(item) {
return GetPublishingPageImage(item, ["DCCAIContentImage"]).then(function(
pub
) {
for (var property in pub.d) {
if (property == "__metadata") continue;
item.DCCAIContentImage(pub.d[property]);
}
});
}
function GetPublishingPageImage(curItem, publishingProperties) {
var query = "/FieldValuesAsHtml?$select=" + publishingProperties;
//debugger;
var endpointUri = curItem["__metadata"].uri + query;
// var endpointUri = curItem.__metadata().uri + query;
return $.ajax({
url: endpointUri,
type: "GET",
processData: false,
contentType: "application/json;odata=verbose",
headers: {
Accept: "application/json;odata=verbose"
}
}).then(function(response) {
return response;
});
}