1

Kentico 13 MVC 核心站点构建

安装成功:

事件正在 Intranet 方案中使用。寻找允许员工在不登录 Kentico CMS 的情况下将新事件添加到日历的最佳方法。(类似于 Kentico 12 CMS 门户引擎中的活动预订系统)

我在日历下方创建了一个带有事件字段的表单,但无法找到将填充下表所有内容的插入语句:

  • 体验活动
  • CMS 树
  • CMS 文档

仅供参考:第一个 MVC 核心项目

提前致谢

4

1 回答 1

0

查看 NuGet 包中包含的页面类型类和提供程序,您可以使用以下代码在事件日历页面下插入新页面。

        var parentPage = EventCalendarProvider.GetEventCalendars()
            .TopN(1)
            .Culture("en-GB")
            .Published()
            .LatestVersion()
            .FirstOrDefault();

        var newEvent = new Event
        {
            EventName = "Test Event",
            EventSummary = "Summary Text",
            EventDescription = "Test Description",
            EventLocation = "Somewhere",
            EventStart = DateTime.Now,
            EventIsAllDay = true,

            // ...etc for the rest of the properties coming from the Kentico Form you've created.
        };

        newEvent.Insert(parentPage);

如果你还没有探索过,你可以使用BizFormItemEvents来拦截表单提交并使用上面的代码插入页面。

于 2021-07-30T21:18:58.413 回答