Copied to clipboard

Flag this post as spam?

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


  • John 88 posts 112 karma points
    May 05, 2011 @ 02:44
    John
    0

    Node types by ID

    Hi,

    Getting a list of nodes of a certain node type alias is easy as there is a nodeTypeAlias property on the Node object, however, the Content Type Picker type for a user control property spits out a list of content type IDs. I've noticed in the App_Data/umbraco.config file that there is infact an attribute on each node called nodeType which stores the ID but there doesn't seem to be any access to it via the API.

    Umbraco 4.7

    Cheers

  • John 88 posts 112 karma points
    Jul 26, 2011 @ 08:02
    John
    0

    Any ideas on this?

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jul 26, 2011 @ 13:46
    Ove Andersen
    0

    uComponents (changeset 81208, will be released with v2.2) has a method for this:

    List<Node> GetNodesByType(int documentTypeId)
    
  • John 88 posts 112 karma points
    Jul 27, 2011 @ 00:26
    John
    0

    Interesting, thanks Ove.

    What I've also done is create my own Macro PropertyType - essentially the same as the contentTypeSingle and contentTypeMultiple except that the value is the Content Type alias, instead of the Content Type ID.

Please Sign in or register to post replies

Write your reply to:

Draft