I'm a beginner with Umbraco Forms.
I have to create different forms with a specific markup for each form.
I found how to change the markup for the forms but it seems like I have only one template for all the forms.
If you wish to customize the markup for a specific form and not all your forms that is also possible.
For a specific form you'll need to create the following folder: ~\Views\Partials\Forms{FormId}\ (FormId needs to be an existing form id, you can view the id of the form in the url
As an example if your form id is 0d3e6b2d-db8a-43e5-8f28-36241d712487 then you can overwrite the form view by adding the Form.cshtml file to the directory First copying the default one and then making your changes is the best way to get started .
ohoy!
im currently also in the process of trying to create some umbraco forms with custom markup and i cant seem to figure out how this works. i have found my form id in the url.
but where do i use the id ? so far i can see the form.cshtml in partials/forms and i figured i need to create a customForm.cshtml in there. but where do i define which forms should use this template ?
and lastly has this been added to the documentation page ?
okay i think i get the idea now. i have created a new Form which is named partials/forms/7dc876b7-0057-4181-8e0d-2bc84d8a80fb/form.cshtml
then i have copied the code from the partials/forms/form.cshtml view and pasted it in and made a small change, to the code. but i dont see any changes in my form.
is there anything i need to do when adding the form macro ?
i have used it like this @Umbraco.RenderMacro("FormsRenderForm", new {FormGuid="7dc876b7-0057-4181-8e0d-2bc84d8a80fb"})
If I make changes to the cshtml file of our.Community.CustomForm package and see those changes reflected at runtime, how can I fix that the updated changes dont lost or replace at runtime?
And the functionality to automatically select a customized view for a specific form based on Form ID is broken again.
My workaround is to hard-code the URL for the Form view.
[Umbraco Forms] Custom templates
Hello,
I'm a beginner with Umbraco Forms. I have to create different forms with a specific markup for each form. I found how to change the markup for the forms but it seems like I have only one template for all the forms.
Is it possible to create a template by form ?
Thanks for your answers.
Hi Laureline and welcome to our :-)
If you wish to customize the markup for a specific form and not all your forms that is also possible.
For a specific form you'll need to create the following folder: ~\Views\Partials\Forms{FormId}\ (FormId needs to be an existing form id, you can view the id of the form in the url
As an example if your form id is 0d3e6b2d-db8a-43e5-8f28-36241d712487 then you can overwrite the form view by adding the Form.cshtml file to the directory First copying the default one and then making your changes is the best way to get started .
I will add this to the documentation page.
Hope this helps,
/Dennis
ohoy! im currently also in the process of trying to create some umbraco forms with custom markup and i cant seem to figure out how this works. i have found my form id in the url. but where do i use the id ? so far i can see the form.cshtml in partials/forms and i figured i need to create a customForm.cshtml in there. but where do i define which forms should use this template ?
and lastly has this been added to the documentation page ?
see my reply below your comment
okay i think i get the idea now. i have created a new Form which is named partials/forms/7dc876b7-0057-4181-8e0d-2bc84d8a80fb/form.cshtml
then i have copied the code from the partials/forms/form.cshtml view and pasted it in and made a small change, to the code. but i dont see any changes in my form.
is there anything i need to do when adding the form macro ?
i have used it like this @Umbraco.RenderMacro("FormsRenderForm", new {FormGuid="7dc876b7-0057-4181-8e0d-2bc84d8a80fb"})
If I make changes to the cshtml file of our.Community.CustomForm package and see those changes reflected at runtime, how can I fix that the updated changes dont lost or replace at runtime?
Information for others, there's a missing slash in Dennis' filepath for custom forms.
It should be ~\Views\Partials\Forms{FormId}\ (FormId needs to be an existing form id, you can view the id of the form in the url)
so for the example above the folder path for custom form should be: ~\Views\Partials\Forms\0d3e6b2d-db8a-43e5-8f28-36241d712487\
Just in case anyone got caught out by this (like me), the location of the form template recently changed:
http://issues.umbraco.org/issue/CON-1557
https://our.umbraco.com/documentation/Add-ons/UmbracoForms/Developer/Themes/
And the functionality to automatically select a customized view for a specific form based on Form ID is broken again. My workaround is to hard-code the URL for the Form view.
is working on a reply...