【问题标题】:Kentico Xperience Event - how to add new eventKentico Xperience 活动 - 如何添加新活动
【发布时间】:2021-07-31 05:18:58
【问题描述】:

Kentico 13 MVC 核心站点构建

成功安装:

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

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

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

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

提前致谢

【问题讨论】:

    标签: kentico kentico-mvc


    【解决方案1】:

    查看 NuGet 包中包含的page type classes and providers,您可以使用以下代码在事件日历页面下插入新页面。

            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拦截表单提交,并使用上述代码插入页面。

    【讨论】:

    • 感谢您的快速回复;我会调查你的解决方案。
    猜你喜欢
    • 2020-10-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-19
    • 1970-01-01
    • 2012-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多