Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeff Smith 4 posts 24 karma points
    Mar 20, 2013 @ 01:33
    Jeff Smith
    0

    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

  • gary 385 posts 916 karma points
    Mar 20, 2013 @ 02:56
    gary
    0

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft