Browse Source

Improved example

pull/13082/head
malik masis 4 years ago
parent
commit
c86db70539
  1. 1
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/ContentParser.cs
  2. 19
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml

1
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/ContentParser.cs

@ -13,6 +13,7 @@ public class ContentParser : IContentParser, ITransientDependency
Content = "**ABP Framework** is completely open source and developed in a community-driven manner."
},
new WidgetContentFragment("CmsPoll") { Properties = { { "widgetName", "poll-right" } } },
new WidgetContentFragment("CmsPollByName") { Properties = { { "name", "poll-name" } } },
new MarkdownContentFragment {
Content = "Thanks _for_ *your* feedback."
}

19
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml

@ -16,12 +16,23 @@
{
@Html.Raw(await MarkdownRenderer.RenderAsync(markdownContentFragment.Content))
}
else if(contentFragment is WidgetContentFragment widgetContentFragment)
else if (contentFragment is WidgetContentFragment widgetContentFragment)
{
@await Component.InvokeAsync(widgetContentFragment.Name, new
//TODO
if (widgetContentFragment.Name == "CmsPoll")
{
widgetName = "poll-right"
})
@await Component.InvokeAsync(widgetContentFragment.Name, new
{
widgetName = "poll-right"
})
}
else
{
@await Component.InvokeAsync(widgetContentFragment.Name,new
{
name = "poll-name"
})
}
}
}
</abp-card-body>

Loading…
Cancel
Save