Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

NewsItems.cshtml

@model NewsContentModel

@{
    //page title
    ViewBag.PageTitle = T("Admin.ContentManagement.News.NewsItems").Text;
    //active menu item (system name)
    NopHtml.SetActiveMenuItemSystemName("News items");
}

@{
    const string hideSearchBlockAttributeName = "NewsContentPage.HideSearchBlock";
    var hideSearchBlock = await genericAttributeService.GetAttributeAsync(await workContext.GetCurrentCustomerAsync(), hideSearchBlockAttributeName);
}

@T("Admin.ContentManagement.News.NewsItems")

@T("Admin.Common.AddNew") @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.NewsListButtons, additionalData = Model })
@*hide the entire search block if no elements are displayed*@
@await Html.PartialAsync("Table", new DataTablesModel { Name = "newsitem-grid", UrlRead = new DataUrl("List", "News", null), SearchButtonId = "search-newsitem", Length = Model.NewsItems.PageSize, LengthMenu = Model.NewsItems.AvailablePageSizes, Filters = new List { new FilterParameter(nameof(Model.NewsItems.SearchStoreId), nameof(Model.NewsItems)), new FilterParameter(nameof(Model.SearchTitle)) }, ColumnCollection = new List { new ColumnProperty(nameof(NewsItemModel.Title)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.Title").Text }, new ColumnProperty(nameof(NewsItemModel.LanguageName)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.Language").Text, Width = "200" }, new ColumnProperty(nameof(NewsItemModel.Id)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.Comments").Text, Width = "200", ClassName = NopColumnClassDefaults.Button, Render = new RenderCustom("renderColumnComments") }, new ColumnProperty(nameof(NewsItemModel.StartDateUtc)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.StartDate").Text, Width = "200", Render = new RenderDate() }, new ColumnProperty(nameof(NewsItemModel.EndDateUtc)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.EndDate").Text, Width = "200", Render = new RenderDate() }, new ColumnProperty(nameof(NewsItemModel.Published)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.Published").Text, Width = "100", ClassName = NopColumnClassDefaults.CenterAll, Render = new RenderBoolean() }, new ColumnProperty(nameof(NewsItemModel.CreatedOn)) { Title = T("Admin.ContentManagement.News.NewsItems.Fields.CreatedOn").Text, Width = "200", Render = new RenderDate() }, new ColumnProperty(nameof(NewsItemModel.Id)) { Title = T("Admin.Common.Edit").Text, Width = "100", ClassName = NopColumnClassDefaults.Button, Render = new RenderButtonEdit(new DataUrl("NewsItemEdit")) } } })