internal static FieldDefinitionElement GetFieldElement(ContentViewDetailElement contentView, string sectionName, string fieldName) { var sectionElement = contentView.Sections[sectionName]; var fieldElement = sectionElement.Fields[fieldName]; return(fieldElement); }
/// <summary> /// Defines the ContentView control for News on the frontend /// </summary> /// <param name="parent">The parent configuration element.</param> /// <returns>A configured instance of <see cref="ContentViewControlElement"/>.</returns> internal static ContentViewControlElement DefineLocationsFrontendContentView(ConfigElement parent) { // define content view control var controlDefinition = new ContentViewControlElement(parent) { ControlDefinitionName = LocationsDefinitions.FrontendDefinitionName, ContentType = typeof(LocationItem), UseWorkflow = false }; // *** define views *** #region Locations List View // define element var locationsListView = new ContentViewMasterElement(controlDefinition.ViewsConfig) { ViewName = LocationsDefinitions.FrontendListViewName, ViewType = typeof(MasterListView), AllowPaging = true, DisplayMode = FieldDisplayMode.Read, ItemsPerPage = 4, FilterExpression = DefinitionsHelper.NotPublishedDraftsFilterExpression, SortExpression = "Title ASC", UseWorkflow = false }; // add to content view controlDefinition.ViewsConfig.Add(locationsListView); #endregion #region Locations Details View // Initialize View var locationsDetailsView = new ContentViewDetailElement(controlDefinition.ViewsConfig) { ViewName = LocationsDefinitions.FrontendDetailViewName, ViewType = typeof(DetailsView), ShowSections = false, DisplayMode = FieldDisplayMode.Read }; // add to ContentView controlDefinition.ViewsConfig.Add(locationsDetailsView); #endregion // return content view control return(controlDefinition); }
/// <summary> /// Defines the ContentView control for News on the frontend /// </summary> /// <param name="parent">The parent configuration element.</param> /// <returns>A configured instance of <see cref="ContentViewControlElement"/>.</returns> internal static ContentViewControlElement DefineProductsFrontendContentView(ConfigElement parent) { // define content view control var controlDefinition = new ContentViewControlElement(parent) { ControlDefinitionName = ProductsDefinitions.FrontendDefinitionName, ContentType = typeof(ProductItem) }; // *** define views *** #region News backend list view var newsListView = new ContentViewMasterElement(controlDefinition.ViewsConfig) { ViewName = ProductsDefinitions.FrontendListViewName, ViewType = typeof(ProductCatalogSample.Web.UI.Public.MasterListView), AllowPaging = true, DisplayMode = FieldDisplayMode.Read, ItemsPerPage = 20, ResourceClassId = typeof(ProductsResources).Name, FilterExpression = DefinitionsHelper.PublishedOrScheduledFilterExpression, SortExpression = "PublicationDate DESC" }; controlDefinition.ViewsConfig.Add(newsListView); #endregion #region News backend details view var newsDetailsView = new ContentViewDetailElement(controlDefinition.ViewsConfig) { ViewName = ProductsDefinitions.FrontendDetailViewName, ViewType = typeof(ProductDetailsView), ShowSections = false, DisplayMode = FieldDisplayMode.Read, ResourceClassId = typeof(ProductsResources).Name }; controlDefinition.ViewsConfig.Add(newsDetailsView); #endregion return controlDefinition; }
/// <summary> /// Defines the ContentView control for News on the frontend /// </summary> /// <param name="parent">The parent configuration element.</param> /// <returns>A configured instance of <see cref="ContentViewControlElement"/>.</returns> internal static ContentViewControlElement DefineAgentsFrontendContentView(ConfigElement parent) { // define content view control var controlDefinition = new ContentViewControlElement(parent) { ControlDefinitionName = AgentsDefinitions.FrontendDefinitionName, ContentType = typeof(AgentItem) }; // *** define views *** #region Agents backend list view var agentsListView = new ContentViewMasterElement(controlDefinition.ViewsConfig) { ViewName = AgentsDefinitions.FrontendListViewName, ViewType = typeof(MasterListView), AllowPaging = true, DisplayMode = FieldDisplayMode.Read, ItemsPerPage = 6, ResourceClassId = typeof(AgentsResources).Name, FilterExpression = DefinitionsHelper.PublishedOrScheduledFilterExpression, SortExpression = "Title ASC" }; controlDefinition.ViewsConfig.Add(agentsListView); #endregion #region Agents backend details view var newsDetailsView = new ContentViewDetailElement(controlDefinition.ViewsConfig) { ViewName = AgentsDefinitions.FrontendDetailViewName, ViewType = typeof(DetailsView), ShowSections = false, DisplayMode = FieldDisplayMode.Read, ResourceClassId = typeof(AgentsResources).Name }; controlDefinition.ViewsConfig.Add(newsDetailsView); #endregion //#region Dialogs definition //AgentsDefinitions.CreateDialogs(controlDefinition.DialogsConfig); //#endregion return controlDefinition; }
/// <summary> /// Defines the ContentView control for News on the frontend /// </summary> /// <param name="parent">The parent configuration element.</param> /// <returns>A configured instance of <see cref="ContentViewControlElement"/>.</returns> internal static ContentViewControlElement DefineLocationsFrontendContentView(ConfigElement parent) { // define content view control var controlDefinition = new ContentViewControlElement(parent) { ControlDefinitionName = LocationsDefinitions.FrontendDefinitionName, ContentType = typeof(LocationItem), UseWorkflow = false }; // *** define views *** #region Locations List View // define element var locationsListView = new ContentViewMasterElement(controlDefinition.ViewsConfig) { ViewName = LocationsDefinitions.FrontendListViewName, ViewType = typeof(MasterListView), AllowPaging = true, DisplayMode = FieldDisplayMode.Read, ItemsPerPage = 4, FilterExpression = DefinitionsHelper.NotPublishedDraftsFilterExpression, SortExpression = "Title ASC", UseWorkflow = false }; // add to content view controlDefinition.ViewsConfig.Add(locationsListView); #endregion #region Locations Details View // Initialize View var locationsDetailsView = new ContentViewDetailElement(controlDefinition.ViewsConfig) { ViewName = LocationsDefinitions.FrontendDetailViewName, ViewType = typeof(DetailsView), ShowSections = false, DisplayMode = FieldDisplayMode.Read }; // add to ContentView controlDefinition.ViewsConfig.Add(locationsDetailsView); #endregion // return content view control return controlDefinition; }