Copied to clipboard

Flag this post as spam?

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


  • Nik 1413 posts 6212 karma points MVP 3x 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 3945 posts 15163 karma points MVP 10x 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 1413 posts 6212 karma points MVP 3x 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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies