Copied to clipboard

Flag this post as spam?

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


  • Jonas Eriksson 930 posts 1825 karma points
    Jun 24, 2012 @ 09:19
    Jonas Eriksson
    0

    Add extra content to the xml content tree (experimental / discussion)

    I was experimenting with adding extra data to the umbraco xml content tree to see how far that would take me to attach external data to umbraco in a nice way.

    The xml content tree is very easy to work with and the nice thing is when we add nodes to it we will get working url's for the extra nodes as well as dynamicnode property population. So we can use /mysite.com/somenode/external-node-1 and @Model.MyExternalProperty

    We will of course need to re-add our external nodes after Umbraco refreshes it's content tree. But there are events we can use for that.

    I plan to use this in a small (non critical) production site for further tests the coming week, and I welcome any input on why this is a bad (or good) idea.

    If nothing else I consider this another interesting exploration into the internal workings of Umbraco :)

    Full code sample https://gist.github.com/2982170

    Code uses PetaPoco as a orm and a small table ExtraData for the external nodes. Table columns : id, nodeName, urlName and bodyText.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 24, 2012 @ 21:42
    Jeroen Breuer
    0

    Seems like a nice idea. Currently the fastest way of doing something similar is by just adding a custom node and store the data in there with for example Embedded Content. Not sure if this is the same, but also wrote a wiki a while ago: http://our.umbraco.org/wiki/reference/code-snippets/add-fake-property-to-a-content-node. Maybe this is something for the mailing list? https://groups.google.com/forum/#!forum/umbraco-dev

    Jeroen

  • Jonas Eriksson 930 posts 1825 karma points
    Jun 25, 2012 @ 15:15
    Jonas Eriksson
    0

    I've been making some more progress on this. I've found a few problems I had to deal with, but no show stopper yet. So, now I have a working site on dev with only the home page as an umbraco document, the rest of the nodes (over 2000 of them) comes directly from the xml, which in turn is populated from my database.

    For my requirements this method seems to work out pretty well. It's a site where the site visitors adds content, and the only way the content should be edited is on the front end. As I add the nodes I get nice url's for each content item, instead of using query-strings. And I can use DynamicNode syntax in my views.

    I'll add a thread about this to the google groups discussion when I have done a bit more explorations.

    Regards

    Jonas

Please Sign in or register to post replies

Write your reply to:

Draft