Custom module get items by State

Posted by Community Admin on 04-Aug-2018 17:28

Custom module get items by State

All Replies

Posted by Community Admin on 18-Mar-2014 00:00

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>>????)

Posted by Community Admin on 21-Mar-2014 00:00

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
 

This thread is closed