如何将表单添加到 Orchard Project 的页面?
我目前在 Orchard CMS 中有一个页面,它只有内容。管理员想要在此页面添加一个表单。
所以我想:
- 管理员可以在右侧管理一些内容。
- 在左侧添加表单。
- 访客有权填写表格并提交。
- 管理员无法修改表单(左侧的内容)。
这可以开箱即用吗?是否有加载项或者我需要编写什么(模块、小部件等)才能将页面拆分为左侧的表单和右侧的内容?
Page
*---------*------------*
* * *
* * admin *
* * editable *
* form * content *
* * *
* * *
*---------*------------*
I currently have a page within Orchard CMS, it only has content on it. The admin would like to add a form to this page.
So I would like:
- to have some content the admin will be able to manage on the right side.
- to add the form on the left side.
- visitors to have access to fill out the form and submit it.
- the form (stuff on the left) to be un-modifiable by the admin.
Is this possible out of the box? Is there an add-in or what would I need to write (module, widget, ...) to be able to split a page with a form on the left and content on the right?
Page
*---------*------------*
* * *
* * admin *
* * editable *
* form * content *
* * *
* * *
*---------*------------*
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要为您的问题的表单创建一个内容部分 。在内容部分的前端视图 .cshtml 中,您可以将 html 包装在
模块构建并运行后,创建一个新的内容类型,该内容类型具有与页面相同的所有部分,但添加新的表单内容部分。现在,当您创建新页面时,您可以将内容正文包装在一个中,
这应该将这两部分放入文章中,如下所示:
You will need to create a content part for the form piece to your problem. In the front end view .cshtml of the content part you can wrap the html in a
Once the module is built and running Create a new Content Type that has all of the same parts as the page, but add your new form content part. Now when you create your new page you can wrap the body of the content in a
This should drop both pieces into the article like so: