I've created a collection of custom field types. These contain a few more properties than the default fields. Is there a way to disable default field types such as "text field" in the form editor.
For example when you click add field you will only see the custom fields
Fixed it in Umbraco 7.2.8 without having to change core files.
Did it by creating a new folder (package) in App_Plugins with only a javascript file and a package manifest which references the javascript file.
Luckily Umbraco will always automatically load this script, also on the Forms pages in the CMS.
The javascript file is an Angular directive which overrides the fieldtypes array that Forms uses to load the available fieldtypes when creating a new field.
angular.module('umbraco.directives').config(function ($provide) {
$provide.decorator('umbFormsDesignerDirective', ['$delegate', function ($delegate) {
var directive = $delegate[0];
var link = directive.link;
directive.compile = function () {
return function (scope, element, attrs) {
var filtered = [];
var fieldsToRemove = [
"Textfield",
"Textarea",
"CheckBox",
"File upload",
"Password Field",
"CheckBoxList",
"DropDownList",
"RadioButtonList",
];
_.each(scope.fieldtypes, function(item) {
if (!_.contains(fieldsToRemove, item.name)) {
filtered.push(item);
}
});
scope.fieldtypes = filtered;
link.apply(this, arguments);
return;
};
};
return $delegate;
}]); });
Hiding field types
I've created a collection of custom field types. These contain a few more properties than the default fields. Is there a way to disable default field types such as "text field" in the form editor.
For example when you click add field you will only see the custom fields
I'm looking for the same option in the latest Umbraco 7.2 | Forms. In the CMS I would like to hide a few default field types for the Form editor.
Anybody any idea if this is possible?
Fixed it in Umbraco 7.2.8 without having to change core files. Did it by creating a new folder (package) in
App_Plugins
with only a javascript file and a package manifest which references the javascript file.Luckily Umbraco will always automatically load this script, also on the Forms pages in the CMS.
The javascript file is an Angular directive which overrides the fieldtypes array that Forms uses to load the available fieldtypes when creating a new field.
is working on a reply...