Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating comment or contact form doesn't set email field type #880

Closed
bjarnef opened this issue Sep 21, 2022 · 4 comments
Closed

Creating comment or contact form doesn't set email field type #880

bjarnef opened this issue Sep 21, 2022 · 4 comments

Comments

@bjarnef
Copy link

bjarnef commented Sep 21, 2022

I noticed when creating a comment or contact form from default templates these add an email field, but these are just regular text input field.

I think these should set email as type by default instead.

Btw. is it possible to customize the templates if a specific project need another standard set of form fields?

Umbraco v10.2.0
Forms v10.1.2

@bjarnef
Copy link
Author

bjarnef commented Sep 21, 2022

Furthermore it seems comment or contact form doesn't respect DisableStylesheet in appsettings.json, but empty form does.

"Forms": {
  "FormDesign": {
    "Defaults": {
      "DisableStylesheet": true
    }
  },
  "Options": {
    "AppendQueryStringOnRedirectAfterFormSubmission": true
  }
}

image

@AndyButland
Copy link

I've made a couple of updates due in 10.2 related to this:

  • Added the "email" field type setting for the two email fields.
  • Added a configuration option: Umbraco : Forms : FormDesign : RemoveProvidedFormTemplates which can be set to true to remove the out of the box templates, provided via a Razor class library, from the list.

Can confirm you can create your own templates if you add them on disk at: \App_Plugins\UmbracoForms\Data\Templates\.

Not taking account of the configuration for DisableStylesheet is expected. The form template used has a setting for "disableDefaultStylesheet": false, and so this is used in preference to the configuration default (which is really only for when you create an empty form).

@bjarnef
Copy link
Author

bjarnef commented Sep 27, 2022

@AndyButland okay, then if we want to keep e.g. the default contact form template, but remove the comment form template is that possible? Furthermore can we modify "disableDefaultStylesheet": true of these standard templates? It seems we can't modify these directly as these are shipped with the static assets.

https://nuget.info/packages/Umbraco.Forms.StaticAssets/10.1.2

image

Would a \App_Plugins\UmbracoForms\Data\Templates\contactform.json override the existing? And it guess we can't just remove one of them (similar with standard email templates, although there is only one currently), but we have to remove both and could copy both commentform.json and contactform.json (or just one of them).

@AndyButland
Copy link

Yes, I'd suggest you would set the new configuration value RemoveProvidedFormTemplates to true. Copy the ones you want to keep to \App_Plugins\UmbracoForms\Data\Templates\ and modify them as you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants