I just started and descided to go with Umbraco v5 for my site.
I've created a Master document type, a Home document type and a TextPage document type. As I understand from video's I create a template called Layout that holds the site framework (header/footer etc.) I then create a subTemplate called Home. I also create a template for TextPage. Now when I create the content for my Home, it uses the Layout and Home templates. All fine. But I also have the TextPage document type that contains blocks of texts.
In the content I can add the Home-page and add 2 TextPage-pages. How do I get the content (layout and content variables) of both textpages to appear in the Home? Do I use code? Or can it be done easier??
I've tried somethings, but it's very hard without examples. I came to this:
Umbraco 5 - Template for document types
Hello,
I just started and descided to go with Umbraco v5 for my site.
I've created a Master document type, a Home document type and a TextPage document type. As I understand from video's I create a template called Layout that holds the site framework (header/footer etc.)
I then create a subTemplate called Home. I also create a template for TextPage.
Now when I create the content for my Home, it uses the Layout and Home templates. All fine.
But I also have the TextPage document type that contains blocks of texts.
In the content I can add the Home-page and add 2 TextPage-pages.
How do I get the content (layout and content variables) of both textpages to appear in the Home?
Do I use code? Or can it be done easier??
I've tried somethings, but it's very hard without examples.
I came to this:
@foreach (var item in DynamicModel.Descendants)
{
<label for="@item.Name">@item.Name</label> <br/>
<label for="@item.Url">@item.Url</label> <br/>
<!--<label for="@ item.Field">Field: @ item.GetPropertyValue("headerText", false)</label> <br/>-->
}
But how do I read the properties from Descendants?
(and what objecttype is Descendants?)
After looking through the forum the rest of the afternoon, this became my solution:
So you don't need to create a template for the sub-content, you just rip the fields and it works!
is working on a reply...