November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Removing it from code is your first response. Don't want code (or properties) that isn't used.
Other options are:
[Ignore]
public virtual int ThisPropertyIsHidden { get; set; }
This will remove it in edit mode altogether. Note though that it won't be indexed by search either...[Editable(false)]
public virtual string NotEditableProperty {get;set; }
This will show the value to the editor but they can't change it[ScaffoldColumn(false)]
public virtual string HideThisPropertyFromEditors { get; set; }
Very similar to Editable attribute above. I would recommend using the Editable attribute normally if you want to have the property in the background but not allowing the editor to touch it.
[] hides the property from the edit UI, but you can still work with it programmatically.
I tried a few of these methods. Removing the property seemed the most obvious, but no luck. I got frustrated and moved on to some other content types and the creation worked as I hoped. The long and short of it is that it seems somehow my original content type is cached somewhere. That type and other types all inherit from the same base class extended from PageData, but it is working as though the code hasn't changed since yesterday afternoon.
The really strange thing, if I change the file and class name from TechnologyInstructionPage to TechnologyInstruction it works as exactly I hope it would. But then when I change back to TechnologyInstructionPage it has old properties showing up I've since deleted from the code and were in a parent class it is no longer inheriting from. It as though something is cached somewhere. This is a strange behavior that only changing the page name actually fixes it. I'd like to have all my content types with the "Page" string as end of file name for consistency, but if I do I end up with some old version of code executing. This is ... worrisome. I have no idea what is causing this.
A few things to note. Properties that have values are not removed. You can however "force remove" them from admin mode. Renaming a content type, without having specified an ID (which is hightly recommended by the way), will create a new type. So that's probably what you're seeing.
Like Johan said, remember to set a guid on your page type otherwise renaming class will mess things up. If you check in admin you will see that you now have multiple page types (TechnologyInstructionPage and TechnologyInstruction) if you forgot to set that guid.
I don't want to use these fields. How do I remove them? This seems like it should be way easier to do than it is.