Copied to clipboard

Flag this post as spam?

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


  • Brian Lacy 28 posts 101 karma points
    Oct 27, 2016 @ 20:20
    Brian Lacy
    0

    How to hide default fieldtypes?

    Jeffrey Schoemaker submitted an issue for Umbraco Forms to allow hiding existing field types, and also mentioned that an upcoming version of Steroids will support this via a config file(see http://issues.umbraco.org/issue/CON-1196).

    I'm wondering if you'd be willing to share now what you guys are doing to implement this? I need this for my own custom field types, so I don't confuse my editors with too many similar options!

  • [email protected] 406 posts 2135 karma points MVP 7x c-trib
    Oct 28, 2016 @ 06:10
    jeffrey@umarketingsuite.com
    1

    Hi Brian,

    you could tweak it already yourselves pretty easy.

    Just go to /App_Plugins/UmbracoForms/Backoffice/Form/overlays/fieldtypepicker/fieldtypepicker.controller.js and find the init()-function (line 17) and replace the init()-function with the following code:

    vm.ExcludedFieldTypes = ["3e170f26-1fcb-4f60-b5d2-1aa2723528fd"]; // The GUID's you want to exclude as a comma seperated list
    
     function init() {
     formResource.getAllFieldTypesWithSettings()
                    .then(function (response) {
                        vm.fieldTypes = [];
                        angular.forEach(response.data, function (key, value) {
                            console.log(value);
                            if (vm.ExcludedFieldTypes.indexOf(value.Id) === -1)
                                vm.fieldTypes.push(value);
                        });
    
                        //vm.fieldTypes = response.data;
                    });
    }
    

    And because it looks like UmbracoForms bundles all its javascript-files into one big file you have to do it in the file /App_Plugins/UmbracoForms/BackOffice/js/umbraco.forms.js (line 2316) too. (Or just do it in this one, because the first one isn't used).

    Et voilá; just hide field types you don't want to use.

    The only cool stuff we have to do in our package is make it a bit smarter so updating your Umbraco Forms installation won't override this code.

    But if you can wait for one more week; we expect to have in the package by next week.

    Cheerio,

    Jeffrey

  • [email protected] 406 posts 2135 karma points MVP 7x c-trib
    Oct 28, 2016 @ 06:11
    jeffrey@umarketingsuite.com
    0

    p.s.: I'm wondering which custom field types you have :)? I'm always interested in the way you implement Umbraco (Forms).

  • [email protected] 406 posts 2135 karma points MVP 7x c-trib
    Nov 22, 2016 @ 12:19
    jeffrey@umarketingsuite.com
    0

    Hi Brian,

    We've updated the package and it supports this functionality now. Please read our blog for how it works: https://www.perplex.nl/blog/2016/umbraco-forms-on-perplex-steroids/

    Cheers, Jeffrey

Please Sign in or register to post replies

Write your reply to:

Draft