Is there a way to load content from an external document in Razor? I'm trying to load some article abstracts from an XML feed, then link to the actual article and render it in a template.
I found @File.ReadAllText but it seems to only work from a file on the actual machine...
You write your own method to read from the feed where method is given feed source and some kind of identifier to xpath out the article? See https://www.nuget.org/packages?q=rss for some libraries you could use to parse the rss.
Loading content from external document
Is there a way to load content from an external document in Razor? I'm trying to load some article abstracts from an XML feed, then link to the actual article and render it in a template.
I found @File.ReadAllText but it seems to only work from a file on the actual machine...
Any ideas?
Amir,
You write your own method to read from the feed where method is given feed source and some kind of identifier to xpath out the article? See https://www.nuget.org/packages?q=rss for some libraries you could use to parse the rss.
Regards
Ismail
Okay, this helps. Is there a way to actually create an Umbraco content node from each feed item?
Amir,
Depending on which version of umbraco you are using
v6 - http://our.umbraco.org/documentation/Reference/Management-v6/Services/ http://our.umbraco.org/documentation/Reference/Management/Documents/
Regards
Ismail
is working on a reply...