public static ContentViewControlElement DefineLocationsFrontendContentView(ConfigElement parent)
{
var controlDefinition = new ContentViewControlElement(parent)
{
ControlDefinitionName = LocationsDefinitions.FrontendDefinitionName,
ContentType = typeof(LocationItem)
};
var LocationsListView = new ContentViewMasterElement(controlDefinition.ViewsConfig)
{
ViewName = LocationsDefinitions.FrontendListViewName,
ViewType = typeof(MasterListView),
AllowPaging = true,
DisplayMode = FieldDisplayMode.Read,
ItemsPerPage = 6,
FilterExpression = DefinitionsHelper.PublishedOrScheduledFilterExpression,
SortExpression = "Title ASC"
};
controlDefinition.ViewsConfig.Add(LocationsListView);
var newsDetailsView = new ContentViewDetailElement(controlDefinition.ViewsConfig)
{
ViewName = LocationsDefinitions.FrontendDetailViewName,
ViewType = typeof(DetailsView),
ShowSections = false,
DisplayMode = FieldDisplayMode.Read
};
controlDefinition.ViewsConfig.Add(newsDetailsView);
return controlDefinition;
}