Hiding properties/elements on episerver forms


Hi i want to hide default episerver form elements or specific properties on default elements that i dont use in edit mode, any way to go about this?

Best regards Jonas.C

May 17, 2016 9:37

I don't know how to do it with code since I haven't worked with Episerver.Forms, but since they are just blocks, you should be able to uncheck the "Available in edit view" option in Admin.

May 17, 2016 10:31

Excellent, this worked. I tried going about it with code first but without success hehe

May 17, 2016 10:56

Just remember that you will need to do this in all envirnoments(test/stage/prod) so it's better to do it with code, but I don't know how/if it's possible right now.

May 17, 2016 10:58

Yeah thats why i wanted to do it with code in the first place.. but this is better then not being able to disable them at all :) 

May 17, 2016 11:00

This should work

var contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
var type = contentTypeRepository.Load(typeof(TextareaElementBlock));
type = (ContentType)type.CreateWritableClone();
type.IsAvailable = false;

May 17, 2016 11:37

Great! Thanks Yauheni :)

May 17, 2016 13:28
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.