mirror of https://github.com/abpframework/abp.git
4 changed files with 15 additions and 12 deletions
@ -0,0 +1,7 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.CmsKit.Contents; |
||||
|
public interface IContent |
||||
|
{ |
||||
|
public List<ContentFragment> ContentFragments { get; set; } |
||||
|
} |
||||
@ -1,26 +1,22 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Microsoft.AspNetCore.Mvc; |
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
||||
using Volo.CmsKit.Contents; |
using Volo.CmsKit.Contents; |
||||
|
|
||||
namespace Volo.CmsKit.Web.Contents; |
namespace Volo.CmsKit.Web.Contents; |
||||
|
|
||||
|
[ViewComponent(Name = "ContentFragment")] |
||||
[Widget( |
[Widget( |
||||
AutoInitialize = true |
AutoInitialize = true |
||||
)] |
)] |
||||
[ViewComponent(Name = "ContentFragment")] |
public class ContentFragmentViewComponent : AbpViewComponent |
||||
public class ContentFragmentViewComponent : ViewComponent |
|
||||
{ |
{ |
||||
public PageDto PageDto { get; set; } |
public IContent ContentDto { get; set; } |
||||
|
|
||||
public ContentFragmentViewComponent() |
|
||||
{ |
|
||||
PageDto = new(); |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<IViewComponentResult> InvokeAsync(PageDto pageDto) |
public virtual async Task<IViewComponentResult> InvokeAsync(IContent contentDto) |
||||
{ |
{ |
||||
return View("~/Contents/ContentFragment.cshtml", new ContentFragmentViewComponent() { PageDto = pageDto }); |
return View("~/Contents/ContentFragment.cshtml", new ContentFragmentViewComponent() { ContentDto = contentDto }); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
|
|||||
Loading…
Reference in new issue