Orchard CMS Projector and Widget
I) Imagine I created a projector to get a list of content types ( Course in my case) and display it.
A new course must meet three conditions:
-
I would like to add new items to this list using jQuery AJAX, including client and server side data validation and data annotation code reuse in models.
-
Before making the AJAX call, a popup dialog will appear using jQuery UI as shown in the image below:
-
but I would like to add only a button on the left side of the projector's course list, this button will bring up a dialog with the form and create a new item (if valid) for that projector using AJAX.
II) We are involved in three scenarios that are involved in this scenario:
-
Course
- Where I define Course Content Type and Partial ViewCreateCourse.cshtml
, where you can find an HTML template to create a form using the jQuery UI dialog.In this project, you can also find a controller
CourseController
with an actionCreateCourse
that calls a service to create a new course content type. -
Orchard.Projections
- Determines where the projector is defined. -
Orchard.Web
- It is determined where the theme is defined and where I can have an alternative to this projection, simply by adding Create element to it , referencing the partial viewCreateCourse.cshtml
in the course project.
Problem: I believe most of my problems are architectural.
The first question is, is there a better approach than explained in II). If so, please let me know.
Considering II) is the best approach:
I would like to know what needs to be replaced with a symbol ~\Orchard.Web\Themes\[Theme Name]\Views\[AlternateName].cshtml
in order to add a button at the top of the projector list.
Is it possible to call a partial view ~\Course/Views/Shared/CreateCourse.cshtml
from an alternative?
Regards
source to share
No one has answered this question yet
See similar questions:
or similar: