Copied to clipboard

Flag this post as spam?

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


  • Philip 59 posts 73 karma points
    Jul 11, 2012 @ 12:49
    Philip
    0

    Possible bug: Can't get document type children

    Hi,

    I am using Umbraco 4.7.2, and would like to retrieve all the Document Types which are beneath a specific document type.

    My setup is e.g. like this:

    - Base Content Doc Type

        - Article Doc Type

    - News Item Doc Type

    I have tried to retrieve the Base Content Document Type like this: DocumentType.GetByAlias("baseContent"), but it seems like there is no children attached, even though this is visible in the Umbraco Backoffice (There property HasChildren is true, but doc.Children is empty). 

    Another solution would be to retrieve all document types which parent is the Base Content Document Type, but if I retrieve the Article Doc Type it says that there are no parents (parentID is -1).

    Am I doing this the wrong way, or might this be a bug?

  • MAxim 4 posts 24 karma points
    Sep 13, 2012 @ 17:00
    MAxim
    0

    Try:

     

    DocumentType.GetAllAsList().Where(d=>d.MasterContentType  == DocumentType.GetByAlias("baseContent").Id

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft