Projector Orchard CMS and widget

别等时光非礼了梦想. 提交于 2019-12-08 03:51:11

问题


I) Imagine that I created a projector get a list of content types (Course in my case) and display it.

The Create new course should satisfy 3 conditions:

  1. I would like to add new elements on this list using jQuery AJAX calls, including data validation on client and server side, and reusing the code of the data annotation at the Models.

  2. Before make the AJAX call, a pop-up dialog using jQuery UI appears, just like represented in the picture bellow:

  3. but I would like to add just a button on the left side of projector course list, this button would pop-up a dialog with a form and it would create a new element (if valid) for this projector using AJAX.

II) We 3 different projects that are participating on that case scenario:

  • Course - Is where I define the Course Content Type and a partial view CreateCourse.cshtml file where you can find the HTML template to create the form using jQuery UI dialog.

    At this project you can also find the Controller to CourseController with the action CreateCourse that call a service to create the new Course Content Type.

  • Orchard.Projections - Is where the Projector is defined.

  • Orchard.Web - Is where the theme is defined, and where I can possibly have an alternate of this projection, just adding a Create Item button in it, referencing the partial view CreateCourse.cshtml in Course project.

PROBLEM: I believe that most of my problems are architectural.

First question, is there a better approach than explained in II). If yes, please let me know.

Considering that II) is the best approach:

I would like to know witch alternate should I override at the ~\Orchard.Web\Themes\[Theme Name]\Views\[AlternateName].cshtml to add the button at the top of the projector list.

Is it possible to call the partial view on the ~\Course/Views/Shared/CreateCourse.cshtml from the alternate ?

Best regards

来源:https://stackoverflow.com/questions/10108136/projector-orchard-cms-and-widget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!