如何将表单添加到 Orchard Project 的页面?

发布于 2024-12-19 11:25:48 字数 475 浏览 4 评论 0原文

我目前在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲鸠 2024-12-26 11:25:48

您需要为您的问题的表单创建一个内容部分 。在内容部分的前端视图 .cshtml 中,您可以将 html 包装在

<div style=”width:50%; float:left;” />

模块构建并运行后,创建一个新的内容类型,该内容类型具有与页面相同的所有部分,但添加新的表单内容部分。现在,当您创建新页面时,您可以将内容正文包装在一个中,

<div style=”width:50%; float:right;” />

这应该将这两部分放入文章中,如下所示:

<article class=”content-item”>

    <div>form</div>

    <div>page copy</div>

</article>

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

<div style=”width:50%; float:left;” />

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

<div style=”width:50%; float:right;” />

This should drop both pieces into the article like so:

<article class=”content-item”>

    <div>form</div>

    <div>page copy</div>

</article>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文