Hello all,
I would like to pull items from a list in another Site Collection to display on a page in my main Site Collection. I have been following this blog, but am looking for something simple in regards to the UI.
When I say simple, I want to start by just displaying the title of an item from another list, and possibly link to it. My container, including the REST call would look like this:
<div id="divContentContainer"></div><script type="text/javascript">
$(document).ready(function ($) {
var basePath = "https://tenant.sharepoint.com/sites/somesite/_api/";
$.ajax({
url: basePath + "web/lists/GetByTitle('News')/items/?$select=Title&$filter=Feature eq 0",
type: "GET",
headers: { "Accept": "application/json;odata=verbose" },
success: function (data) {
//script to build UI HERE
},
error: function (data) {
//output error HERE
}
});
});</script>My question is, what should I put in the section that is commented out named //script to build UI here, so I can output a simple list, much like the Content Query Web Part? More importantly, I am looking for some good references/best practices to pulling data from SharePoint lists in other Site Collections. I am using SharePoint Online, or else I would leverage the Cross-Site Publishing feature.
Thanks,
Kelly
Personal Blog: http://thebitsthatbyte.com