I am a new Umbraco user, using Umbraco 6.0.2 with the Mvc rendering model.
I am writing code that looks like:
@{
foreach(var childNode in Model.Children) {
<a href="@childNode.Url">
}
I am assuming that the "childNode" object in the code above is a IPublishedContent instance?
Is there documentation on what properties are available on the IPublishedContent interface or do I need to look at the source code? I currently am using .Url, .GetProperty, .GetPropertyValue, and .Name. Just wondering what else is avilable on the interface.
Hope it helps, will certainly point in the right direction.
Just a quick point that 6.0.2 uses Razor V2, if you are in a codeblock @{}, you do not need the @ in front of childNode. It can cause some odd things to happen, like taking it out of code. If you have WebMatrix or Visual Studio you will get Intellisense help if using @Model.
IPublishedContent properties?
Hello,
I am a new Umbraco user, using Umbraco 6.0.2 with the Mvc rendering model.
I am writing code that looks like:
@{
foreach(var childNode in Model.Children) {
<a href="@childNode.Url">
}
I am assuming that the "childNode" object in the code above is a IPublishedContent instance?
Is there documentation on what properties are available on the IPublishedContent interface or do I need to look at the source code? I currently am using .Url, .GetProperty, .GetPropertyValue, and .Name. Just wondering what else is avilable on the interface.
Thanks,
Jeff
Hi Jeff
This is not definitive as it is for 4.7 but it still remains the best source of available properties;
http://our.umbraco.org/projects/developer-tools/razor-dynamicnode-cheat-sheet.
Hope it helps, will certainly point in the right direction.
Just a quick point that 6.0.2 uses Razor V2, if you are in a codeblock @{}, you do not need the @ in front of childNode. It can cause some odd things to happen, like taking it out of code. If you have WebMatrix or Visual Studio you will get Intellisense help if using @Model.
Regards
g
is working on a reply...