Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nik 1517 posts 6705 karma points MVP 5x c-trib
    Mar 12, 2021 @ 10:17
    Nik
    0

    Umbraco Forms - Disable core Field Types

    Hi Everyone,

    Hopefully a quick question...

    Is it possible to disable core Question Types in Umbraco Forms?

    Scenario:

    Client wants Recaptcha v3 - Invisible setting up. But wants the core v2 versions removing so editor can't accidently select them.

    Cheers

    Nik

  • Lee Kelleher 3993 posts 15621 karma points MVP 12x admin c-trib
    Mar 12, 2021 @ 10:28
    Lee Kelleher
    100

    Hi Nik,

    I do this on most of my client projects now...

    Also removes the workflows that I don't want my client to play with too.

    using Umbraco.Core;
    using Umbraco.Core.Composing;
    using Umbraco.Web;
    
    namespace Our.Umbraco.Web
    {
        public class Composer : IUserComposer
        {
            public void Compose(Composition composition)
            {
                // UmbracoForms - Form Fields
                composition
                    .WithCollectionBuilder<Umbraco.Forms.Core.Providers.FieldCollectionBuilder>()
                        .Exclude<Umbraco.Forms.Core.Providers.FieldTypes.Password>()
                        .Exclude<Umbraco.Forms.Core.Providers.FieldTypes.Recaptcha2>()
                ;
    
                // UmbracoForms - Workflows
                composition
                    .WithCollectionBuilder<Umbraco.Forms.Core.Providers.WorkflowCollectionBuilder>()
                        .Exclude<Umbraco.Forms.Core.Providers.WorkflowTypes.SaveAsFile>()
                        .Exclude<Umbraco.Forms.Core.Providers.WorkflowTypes.SendXsltEmail>()
                ;
            }
        }
    }
    

    Cheers,
    - Lee

  • Nik 1517 posts 6705 karma points MVP 5x c-trib
    Mar 12, 2021 @ 11:11
    Nik
    1

    Lee, you are an absolute star. I thought it might be something like this.

    Cheers

    Nik

Please Sign in or register to post replies

Write your reply to:

Draft