Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stigmata86 6 posts 25 karma points
    Aug 20, 2009 @ 15:55
    Stigmata86
    0

    Umbraco site as a datafeed?

    Is there any comfortable way of using umbraco site as an editing system for another, non-umbraco site?

    For example, compose pages to display on non-umbraco site without having umbraco source code in the solution.

  • Chris Larson 48 posts 63 karma points
    Aug 20, 2009 @ 16:13
    Chris Larson
    0

    Three things readily come to mind on this.

    1) Use Umbraco on one site and pull the data in through an iFrame component (or other mechanism) on the other site

    2) Develop a web service for Umbraco that would hook in to the existing site and pull the relevent information over to the other site.

    • Realistically, you could pass a node id or friendly name over to the web service, and the service could return the XML document for your site to parse. However, things like images, members, macros and other linked objects in the XML document that reference other Umbraco nodes would need to be translated into some form of HTML for rendering. This does work for pulling raw data across (or pushing data back). I have used this technique to automate passing member objects and other data items between sites when necessary.
    • Conceptually, you could pass a node id or friendly name over to the web service, and the service could return a StreamReader object that contained the rendered HTML from Umbraco. I have never tried this, but it is possible in theory.
    3) Use the REST API to pass data from Umbraco to your site. Again, images and other linked objects could potentially be an issue. I have not used the REST API, so hopefully someone else could comment on how it works in more detail.

  • Stigmata86 6 posts 25 karma points
    Aug 20, 2009 @ 16:31
    Stigmata86
    0

    Thank you, Chris, so much.

    I liked the idea with the webservice called with nodeId param, but have some more questions:

    1. What can be there in umbraco API that can give me umbraco rendered html for a particular node?
    2. How did you collect necessary data on umbraco site? Mining in the db? Or there is something more convinient in the API?
  • Daniel Lindstrom 454 posts 271 karma points
    Aug 20, 2009 @ 17:00
    Daniel Lindstrom
    0

    Take a look at RenderTemplate, takes a node id and a template id and render the HTML it for you.

    I have used it in scenarios similar to what you describe.

    Very simple scenario:

    Another page/site calls a page on your umbraco installation (from server, or client using something like jquery ajax). This page uses a template that only holds an xslt macro. The node id to be rendered as a querystring parameter. This macro on the page renders the node using RenderTemplate.

    You could also have the xslt macro return xml or json, without rendering HTML.

     

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 20, 2009 @ 17:00
    Dirk De Grave
    0

    Hi stigmata86,

     

    1. API has some methods to a page using a specified template. don't know the syntax by heart, but i do know that it has been fixed in v4 as that wasn't working in v3

    2. Again, umbraco api to the rescue, and for collecting data from the umbraco site, use the nodeFactory (umbraco.presentation) as this handles with published content xml in a performant and readonly way.

     

    It's alos possible to query documents in the umbraco install, even if not published, but would advice against that as that would involve lots of db interaction

     

    Hope this helps.

     

    Regards,

    /Dirk

  • bob baty-barr 1180 posts 1294 karma points MVP
    Aug 21, 2009 @ 02:34
    bob baty-barr
    0

    i have used various areas of an umbraco site to feed widgets, etc. so feeding other websites should be the same...

    you could write macros to output xml or json and call the page with the macro and parse them on the other site

Please Sign in or register to post replies

Write your reply to:

Draft