Copied to clipboard

Flag this post as spam?

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


  • Steven Newstead 62 posts 103 karma points
    May 12, 2011 @ 12:15
    Steven Newstead
    1

    Getting page descendents

    Hi all,

    We are using and loving this package, I'm currenty trying to do something that I am not sure is possible or not, here it goes...

    In a code file I am finding the descendents of a node, this node is generated from a Document Type called Event, this document type was written in uSiteBuilder. So I grab all the event Dynamic Nodes from Umbraco with standard umbraco code.

    So at this point I have a list of Dynamic Nodes are all Events

    So my question is, can I then map the Dynamic Nodes to my strongly typed uSiteBuilder Event class? This way I get a strongly typed list of my Events which I can use in my Razor file.

    Does that make sense? I've read it back and I'm not sure event I understand what I've just written....

    Thanks,

    Steve

     

     

  • Vladan Ostojic 94 posts 210 karma points
    May 12, 2011 @ 12:37
    Vladan Ostojic
    1

    Hi Steve,

    I think I didn't understand everything correctly. Did you use ContentHelper class and its static methods to get Events? Can you paste your code here? You should be able to accomplish getting content without standard Umbraco code (so only by using ContentHelper). For example, there is method ContentHelper.GetChildren(int parentId) which will return descedants for a given Umbraco node id. In template, you can get id as this.CurrentContent.Id.

    BTW, if you have instance of Umbraco node, than you can always get instance of appropriate uSiteBuilder class if you use ContentHelper.GetByNodeId method (whose parameter should be id of that Umbraco node).

     

    Regards,

    Vladan

  • Steven Newstead 62 posts 103 karma points
    May 17, 2011 @ 11:10
    Steven Newstead
    0

    Hi Vladan,

    That's it exactly, the ContentHelper.GetChilden was exactly what I was after, many thanks.

Please Sign in or register to post replies

Write your reply to:

Draft