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 :)
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.
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.
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
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
is working on a reply...