If your site is structured in a way that Masterpage is your home page and Books is a direct child under it with document type alias, say for example called "books", and chapters with document type alias "chapters", you could write something like,
@{
var books = Model.Content.Site().Children("books").Where(x => x.IsVisible()).FirstOrDefault();
var chapters = books.Children("chapters").Where(x => x.IsVisible()).ToArray();
}
@*Get properties from books*@
<p>@books.GetPropertyValue("alias")</p>
@*In the get properties from chapters*@
<ul>
@foreach(var item in chapters ){
<li>
<a href="@item.GetPropertyValue("alias")">@item.Name</a>
</li>
}
</ul>
get properties value
I'm new to umbraco. I have different pages under Master page e.g. Books, chapter, Home. Chapters is the child page of books.
I want to call books document different properties like bookname, authorname including chapter document description property on my home page.
I need help.
Hi Zubair,
If your site is structured in a way that Masterpage is your home page and Books is a direct child under it with document type alias, say for example called "books", and chapters with document type alias "chapters", you could write something like,
is working on a reply...