This project is read-only.

Creating a form for one or multiple content pages

Sep 29, 2010 at 10:53 PM

If I wanted to add a  form on a content page or the same form on multiple content pages. What is the best way to go about doing that?

Sep 29, 2010 at 10:55 PM

Can you give a little more details about your scenario? One good place to start may be the comments module, which has a front-end form to enter new comments.

Sep 29, 2010 at 11:16 PM
Edited Sep 29, 2010 at 11:28 PM

We have a current website in sitefinity cms that we would like to have it moved into Orchard.  On the homepage, there is a simple form with a single field asking for a zipcode.  On postback, it goes through some logic... writes some data to the db.. then redirects to another content page.  This form appears on the homepage and some but not all of the subpages.  


I'm just a little confused on how to go about this with such little documentation on extending Orchard. I wouldn't think this build this as a content part but would that be the only way to do it?



Sep 29, 2010 at 11:28 PM

This seems like a widget, widgets being a feature we are currently developing (iteration finishes in a little more than 2 weeks). The implementation of the widget itself could be a regular MVC form with a regular MVC controller to handle the postback.

If you don't want to wait, you will have to programmatically inject the UI for the form into the view.

Sep 29, 2010 at 11:30 PM
Edited Sep 29, 2010 at 11:32 PM

I saw the changeset (10768972d7e7 ) where Orchard.Widget was added

Sep 29, 2010 at 11:31 PM

Yes, that is part of that work.