"Customizing" how Orchard.CustomForms displays in Admin and Front-end

Topics: Customizing Orchard, General
Jun 25, 2013 at 3:15 AM
Edited Jun 25, 2013 at 3:16 AM
I'm trying to customize how Custom Forms display in the Admin (Submissions > Item) and in the UI. Styling (i.e., CSS) is not really the issue. I am just unable to figure out exactly how the .cshtml View files work.

When in Admin > Submissions > Item (being data saved in the form), my fields do not show up how I set them up in Content Types. If I set them up (Placement button) to show 1,2,3,4,5,6 they wind up showing up as 4,5,1,2,3 with 6 not displaying at all. Now, 4 and 5 are date/time fields and 6 is a textarea (multi-line) - don't know if that's the problem.

However, if I click Edit then my fields show up in the proper order.

On the other hand, when I click "Preview" to view on the front-end, they show up as 6,1,2,3,4,5.

In either case, looking at the .cshmtl View files in CustomForms I cannot figure out the how/why of it.

The long & short of it is I'd like to display in both the Admin and front-end 1,2,3,4,5,6. I suspect in the case of the Admin display it's just cutting off the last one, but I still can't figure out why a) it's out of order in the Admin (4,5,1,2,3) and also out of order in the front-end (6,1,2,3,4,5).

I suspect that creating two .cshtml View files in my Theme would do the trick - it's just the matter of figuring out how.

Any guidance is much appreciated.
Coordinator
Jun 26, 2013 at 3:32 AM
You should be able to modify the order of parts and fields by going to the content type editor and choosing admin placement.
Jun 26, 2013 at 5:34 AM
Apologies if I am doing it wrong, but I went to ~/Admin/ContentTypes/Edit/[NameOfMyFormContentType] and hit the "Edit Placement" button and arranged it in the order I wanted it. The actual form (which I put in a widget) on the site that takes user submissions shows up just like that (i.e., perfect). It's the back-end Admin displays and the front-end display of the data that is submitted by the user that I am stuck with.
Coordinator
Jun 26, 2013 at 5:36 AM
Ah, yes, for those display types you'll have to set-up regular placement: http://docs.orchardproject.net/Documentation/Understanding-placement-info
Jun 26, 2013 at 5:48 AM
Edited Jun 26, 2013 at 5:55 AM
My mistake. I keep thinking of placement only in terms of front-end public stuff. I don't use it in any of my modules in the back-end. Thanks.

EDIT: Just my 2 bits. If your're creating a lot of forms that's a lot of extra stuff to keep track of (i.e. each fields identifying info - imagine having 25-50 spread throughout the site). For this I was toying with the code @sfmskywalker blogged about relating to creating modules that create forms using IFormProvider.
Aug 28, 2013 at 1:08 AM
I have the same problem, I need move the order of the fields on Forms or custom types. how can we do that?
Aug 28, 2013 at 1:16 AM
I found a way to change the order of the fields. you need click on "Edit Placement" button. There you could change that field order.