More explanation about [Ignore] attribute

Vote:
 

Hi all,

as [Ignore] attribute's comment states - "When applied to the property of a model type, specifies that the property should be ignored" - and it did exactly what I needed - hid the property input field from the UI in admin panel. 

However does that mean that this attribute will destroy property value of previously created pages with that property?

What I exactly want to do is to introduce new property on a page type and to use it instead of old one, but I can't remove old one, but want to hide it so admins wouldn't use it.

Cheers!

#208335
Oct 22, 2019 9:58
Vote:
 

Episerver will not delete your data. You may safely add the [ignore]-attribute, or even completely remove the property definition from your code. As long as the property contains data, it will not be completely deleted.

You may also use:

[ScaffoldColumn(false)]



See http://www.jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-properties/how-to-hide-a-property-in-episerver-cms-and-how-to-make-a-property-readonly

#208350
Edited, Oct 22, 2019 13:12
Vote:
 

Hi Fugio,

"does that mean that this attribute will destroy property value of previously created pages"

No, [Ignore] attribute will not destroy previously saved property values. It will hide the Property.

Here is a good reference http://www.jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-properties/how-to-hide-a-property-in-episerver-cms-and-how-to-make-a-property-readonly

#208351
Edited, Oct 22, 2019 13:15
- Oct 22, 2019 13:17
Haha @tomas you beat me by 3mins!
- Oct 22, 2019 13:17
Haha, type faster next time! :-)
- Oct 22, 2019 13:20
I was on my phone!!
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.