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

Forums / Developing with Sitefinity / Custom module get items by State

Custom module get items by State

2 posts, 0 answered
  1. BB
    BB avatar
    7 posts
    Registered:
    05 Oct 2012
    18 Mar 2014
    Link to this post
    I created custom module to display locations. I'm using data type "Address". So it's easy to add a location. However when I try to get items by location, I don't know how.

      var myLocations = dynamicModuleManager.GetDataItems(rmylocationType)
                        .Where(d => d.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live
    && (?? I don't know this part. GetValue<Address>>????)
  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    21 Mar 2014
    Link to this post
    Hi,

    You have detailed code reference for each of your modules located under Administration->Module Builder->Your module-> Code Reference for Your module. The correct way for you to get the field in question is presented below.

    DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
             Type MyType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.YourModuleName.YourContentTypeName");
     
             var TheType= dynamicModuleManager.GetDataItems(MyType).FirstOrDefault();
     
             var MyField = TheType.GetValue("FieldName");


    Regards,
    Ivan D. Dimitrov
    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
     
2 posts, 0 answered