I'm simply trying to get a property but cant get it to work from what little documentation there seems to be available.
<ul id="navigation">
@{
@* Get the current node, then walk up the tree from the current page to get the root node *@
var currentPage = DynamicModel;
var homePage = DynamicModel.AncestorsOrSelf.Last();
}
<li @(homePage.Id == currentPage.Id ? "class=active" : "")><a href="@homePage.Url" title="@homePage.Name">@homePage.Name</a></li>
@foreach(var childPage in homePage.Children)
{
@childPage.GetProperty("pageTitle").Value
string docType = childPage.NodeTypeAlias;
switch(docType)
{
case "standard":
<li @(((childPage.Id == currentPage.Id) || (childPage.Id == currentPage.AncestorsOrSelf.FirstOrDefault().Id)) ? "class=active" : "")><a href="@childPage.Url" title="@childPage.Name">@childPage.Name</a></li>
break;
case "contact":
<li>contact</li>
break;
case "work":
<li>work</li>
break;
default:
<li @(((childPage.Id == currentPage.Id) || (childPage.Id == currentPage.AncestorsOrSelf.FirstOrDefault().Id)) ? "class=active" : "")><a href="@childPage.Url" title="@childPage.Name">@childPage.Name</a></li>
break;
}
</ul>
Whilst inside the loop, I simply want to check the value of a particular property using this:
@childPage.GetProperty("pageTitle").Value
but I get the YSOD.
Any help?
Is there any way to list all the properties of a node as you used to be able to do with xslt? Feels like you have to work blind with this stuff otherwise.
get property?
Back again,
I'm simply trying to get a property but cant get it to work from what little documentation there seems to be available.
Whilst inside the loop, I simply want to check the value of a particular property using this:
but I get the YSOD.
Any help?
Is there any way to list all the properties of a node as you used to be able to do with xslt? Feels like you have to work blind with this stuff otherwise.
Ta.
is working on a reply...