SaaS CMS has officially launched! Learn more now.

Hiding a property using ScaffoldColumn


I have done some property hide using ScaffoldColumn in code. But when in Admin mode i have checked "display in edit view" check box under content type then this porperty is displayed in editor screen once again.

So how i will disable that check box "display in edit view" and hiding the property from code base permanently.So in admin no one can checked the "display in edit view"  anymore.

Sep 20, 2016 9:21

What about hooking into ContentTypeRepository events and listen for updates on that content type? And if value is changed - set it back to false.

Sep 20, 2016 12:11

If you never want the property to be editable in EPiServer or even show up there you can do;

public string PropertyOnModelThatIdontWantToBeEditable { get; set; }

If you just want to update your page/blocktype to whats defined in code then you can do a "Revert to default" on the type in admin.

Sep 23, 2016 14:45

I think Jens' suggestion works, but keep in mind that an [Ignore] attribute will also exlude the property from indexing.

Sep 24, 2016 19:10
Tim Schmelter - Feb 21, 2020 15:12
No indexing means that the property will stay visible because EPI doesn't recognize the change?
I'm still not sure what is the best way to hide a property, so that the CMS editor can't see it anymore.
Sometimes we use [Ignore]+[ScaffoldColumn(false)] and sometimes one of it.
* 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.