+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Using api get all the field's information for a custom dynamic module.

Using api get all the field's information for a custom dynamic module.

3 posts, 0 answered
  1. Uttam
    Uttam avatar
    21 posts
    Registered:
    17 Mar 2015
    15 May 2015
    Link to this post

    Hi,

    Using api, is it possible to get all the field's field name & field type including related data for a given custom dynamic module ?

    I poke around and found some information about the fields in DynamicModulesConfig.config but wondering if their is a api from sitefinity to get access of all those fields information.

    Any information is helpful. 

    Thanks!!!

     

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    20 May 2015
    Link to this post
    Hello Uttam,

    In order to get all the field of the content type you need you can use ​MetadataManager.

    Below is a sample code snippet that you can use:
    Type contentType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.MyModule1.MyContentType");
     
    var metadataManager = MetadataManager.GetManager();
     
    var contentMetaType = metadataManager.GetMetaType(contentType);
    var fields = contentMetaType.Fields;
    foreach (var field in fields)
    {
        var fieldName = field.FieldName;
        var fieldType = field.ClrType;
    }


    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Uttam
    Uttam avatar
    21 posts
    Registered:
    17 Mar 2015
    20 May 2015 in reply to Svetoslav Manchev
    Link to this post
    Great!!! Thanks Svetoslav.
3 posts, 0 answered