protected override void OnInit(EventArgs e) { base.OnInit(e); var contentEngine = Container.Current.Resolve <IContentEngine>(); var currentCommunity = _communitiesQuery.GetCurrentCommunity(); if (currentCommunity != null) { _item = contentEngine.GetContentItem <SectionContentItem>(ContentSectionName, currentCommunity.Id); } cvSidebarSection.ItemName = ContentSectionName; cvSidebarSection.TemplateUrl = "~/cms/ContentTemplates/SidebarSectionContentTemplate.ascx"; }
public static void AddSectionContent(this IContentEngine contentEngine, Vertical vertical, bool enabled, string sectionName, string sectionTitle, string sectionContent) { var contentItem = new SectionContentItem { Name = sectionName, IsEnabled = enabled, VerticalId = vertical == null ? (Guid?)null : vertical.Id, SectionTitle = sectionTitle, SectionContent = new HtmlContentItem { Text = sectionContent } }; contentEngine.CreateContentItem(contentItem); }