Copied to clipboard

Flag this post as spam?

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


  • vladzebu 59 posts 346 karma points
    Jul 10, 2009 @ 06:35
    vladzebu
    0

    get DocumentType of a Docoment

    How can i find the DocumentType of a Document ? 

    I get the Template of a Document but io did't find the DocumentType. 

    Best regards , Vlad. 

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jul 10, 2009 @ 06:44
    Aaron Powell
    101

    If you're in the Document API you want the ContentType property.

    If you're in the Node API you want to use DocumentType.GetByAlias(string alias);

    var docType = document.ContentType;
    var docType2 = DocumentType.GetByAlias(new Node(1234).NodeType);
  • vladzebu 59 posts 346 karma points
    Jul 10, 2009 @ 06:53
    vladzebu
    0

    Thanks ; 

     ContentType ct = doc.ContentType;

                int id=ct.Id;

                string alias = ct.Alias;

    This is the final solution for ID and Alias 

Please Sign in or register to post replies

Write your reply to:

Draft