Copied to clipboard

Flag this post as spam?

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


  • richard rowles 18 posts 118 karma points notactivated
    Oct 04, 2018 @ 16:25
    richard rowles
    0

    Get List of Document Type Properties

    Hi,

    I'm trying to get a list of the properties of a document type. I'm a bit stuck though.

    I can see the IPropertyType has a collection"PropertyGroupCollection" and within that "PropertyType" collection, and within that The propties I'm after... But how to I get to them something like.... IContentType ict = Services.ContentTypeService.GetContentType("MyDoc");

        foreach(PropertyType pt in ict.xxx.xxxx.xxxx)
            { 
            }
    

    TIA Rich.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Oct 04, 2018 @ 18:02
    Kevin Jump
    1

    Hi Rich

    it depends a bit on where you are and what you are after :

    on a ContentType you can loop through ict.PropertyTypes

    e.g

    foreach(var property in ict.PropertyTypes)
    {
       // do things
    }
    

    however if you might want all the property types (include those that might have been inherited from other content types if you have compisitions)

    for this you should use ict.CompositionPropertyTypes which will list all the properties you would see if you where looking at a content item in the back office.

  • richard rowles 18 posts 118 karma points notactivated
    Oct 05, 2018 @ 10:36
    richard rowles
    0

    Amazing thanks Kev.

Please Sign in or register to post replies

Write your reply to:

Draft