Best way to make MVC form information more "dynamic"?
I currently have the MVC forms on my site set up so that all the customizable information (title, copy, thank you message, what email address the form is sent to, etc.) is customizable in Umbraco and then the node ID of the form page is hardcoded within the form model code. The ID is set and the field values are pulled through the model as public strings. This is fine if I only need one form but less fine if I want forms with different titles, copy, or going to different email addresses.
Is there a way I can set this up so that forms can be selected via a Content Picker instead of having to hard code the IDs? I would like to have the form as a Nested Content type and select the details from there, but re-use the same MVC files for multiple forms.
I'm not familiar with the way that information could be passed through the MVC files so that everything about the form is more dynamic. I don't mind completely starting over with my form setup if it means avoiding hardcoding how the form pulls its content information.
I reiterate that I really just need a method for grabbing IDs through MVC files. I just don't know the code that would be necessary for capturing an ID from a content picker and sending that ID's information through to be used by the form.
Best way to make MVC form information more "dynamic"?
I currently have the MVC forms on my site set up so that all the customizable information (title, copy, thank you message, what email address the form is sent to, etc.) is customizable in Umbraco and then the node ID of the form page is hardcoded within the form model code. The ID is set and the field values are pulled through the model as public strings. This is fine if I only need one form but less fine if I want forms with different titles, copy, or going to different email addresses.
Is there a way I can set this up so that forms can be selected via a Content Picker instead of having to hard code the IDs? I would like to have the form as a Nested Content type and select the details from there, but re-use the same MVC files for multiple forms.
I'm not familiar with the way that information could be passed through the MVC files so that everything about the form is more dynamic. I don't mind completely starting over with my form setup if it means avoiding hardcoding how the form pulls its content information.
Hi
Try to use Umbraco Forms - https://umbraco.com/products/umbraco-forms/
It's not free, but it's the best way to manage forms with Umbraco CMS.
Thanks,
Alex
Sorry, that's not what I'm after.
Does anyone have any ideas?
I reiterate that I really just need a method for grabbing IDs through MVC files. I just don't know the code that would be necessary for capturing an ID from a content picker and sending that ID's information through to be used by the form.
is working on a reply...