automatically creating a umbraco document from XHTML
Hi
We are getting XHTML of few pages from a webservice of our data providers. We need to create a static website using this XHTML content. We are thinking of using Umbraco to create this website dynamically.
Is there a way in Umbraco to create a document using this XHTML using API ?
I already know that I could use API to create documents, but this XHTML is creating uncertainity.
Create a usercontrol GeneratePagesFromWebservice.ascx that calls your webservice and creates new documents, inserting the xhtml in the "bodyText" property.
Is this more or less what you're looking for or did I misunderstood your requirements?
There is no such thing as a "document folder" in Umbraco.
You can build a hiarchy with child and parent documents, much like how an XML file looks like.
If you want to group documents under an "empty" document, you could just make another Document Type for that. Call it "Document Container" and don't add any properties to it.
Also consider what you want to happen when the user goes to home/portals in his browser address bar. You could easily call an XSLT in the Document Container's template that lists all child documents, for example. (See Developer Area > Right-click XSLT files > create a new XSLT file and look at the built-in templates)
automatically creating a umbraco document from XHTML
Hi
We are getting XHTML of few pages from a webservice of our data providers. We need to create a static website using this XHTML content. We are thinking of using Umbraco to create this website dynamically.
Is there a way in Umbraco to create a document using this XHTML using API ?
I already know that I could use API to create documents, but this XHTML is creating uncertainity.
Any thoughts ?
Hi.
You could:
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<umbraco:Item field="bodyText" runat="server"></umbraco:Item>
Is this more or less what you're looking for or did I misunderstood your requirements?
Hi Thomas
Many thanks. I think this ie pretyt much it I suppose. I will try this and will get back to you.
Cheers
Faiyaz
For your reference, here's an example of how you would add the documents:
Thanks Thomas
Faiyaz
Hi Thomas
Can we programatically create folders as well in umbraco ?
for example
home/portals/long-term-conditions.aspx
"portals" is the folder.
Thanks
Faiyaz
Portals would be a document so it would be created the same way
Hi Thomas
Can we programatically create folders as well in umbraco ?
for example
home/portals/long-term-conditions.aspx
"portals" is the folder.
Thanks
Faiyaz
Thanks Daniel
Faiyaz
There is no such thing as a "document folder" in Umbraco.
You can build a hiarchy with child and parent documents, much like how an XML file looks like.
If you want to group documents under an "empty" document, you could just make another Document Type for that. Call it "Document Container" and don't add any properties to it.
Also consider what you want to happen when the user goes to home/portals in his browser address bar. You could easily call an XSLT in the Document Container's template that lists all child documents, for example. (See Developer Area > Right-click XSLT files > create a new XSLT file and look at the built-in templates)
... and add documents as children of the parent ("folder") document
Thanks very much both
Very helpful.
Faiyaz
is working on a reply...