Consume and display XML feed

Matt Davis asked on June 27, 2017 13:58

We have a few page types that build up a recent news & events feed on the home page. I'd like to use the REST API to display this content on the separate intranet site. I’ve tried to combine the XML Data Source web part with the Universal Viewer web part. The viewer seems to spit out the actual XSLT XML w/out processing it.

Should I be going down a different path? Anyone able to get XSLT transformations to work?

Thanks!

Correct Answer

Brenden Kehren answered on June 27, 2017 15:37

I'd create an RSS page on your site and just use that XML feed from there. Simple easy and you don't have to open yourself up for additional vulnerabilities by opening up the REST API. Then you can easily consume that XML feed in another site with the XML webpart. Also I believe you need to specify how you want the REST content to be returned, by default I think it's json.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on June 27, 2017 15:18

How about a little more on your setup. Are these 2 sites in the same Kentico instance? You mentioned using REST to get the content but then in the same sentence also mentioned using an XML Datasource webpart; which is it?

If they are in the same Kentico instance then you can query that site directly without the need for any XML datasource webpart, just use a repeater and specify the path and site name of the site the news/events are on.

1 votesVote for this answer Mark as a Correct answer

Matt Davis answered on June 27, 2017 15:33

Two different instances. Xml web part pointing at /rest/content/currentsite/en-us/all/, hash authenticated, appropriate classnames set, orderby, etc.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on June 27, 2017 16:47

If you need Hierarchy Support, keep in mind you can utilize the Universal API Viewer with Hierarchy Support tool i built, but it does require you to manually configure and define the structure of the XML.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.