November Happy Hour will be moved to Thursday December 5th.

How to ignore an inbuilt EPiServer property?

Vote:
 

How to ignore an inbuilt EPiServer property and override with the custom property? Trying to override "icontent_name" property with a custom property

#174983
Feb 09, 2017 3:03
Vote:
 

Why do you want to override it, can't you just do a property next to it and hide the built in from the editors (and maybe set a default value on it if it is needed)?

What property do you want to override?

#174988
Feb 09, 2017 7:37
Vote:
 

I need to override the "Name" property when creating a PageType for all languages except master language. And  you are right, hiding it will do it but the issue with the existing "Name " values . For custom properties , we have "Revert to Default" or when we uncheck the "Unique value per language" it will automatically clear all the existing values. But as this is an inbuilt EPi property, what would be the best way to clear the existing values and copy the values from master language?

Thats why I though if I create a new property and ignore the existing property and override it with the new property I created that will make my life easier.

I did try this in my content model where I created the new property "SiteName" but the index parameter for "this" never is any propertyname.

[Ignore]
public override object this[string index]
{
 get
 {
if (index == "icontent_name")
 {
return SiteName;
}
 return base[index];
 }set { base[index] = value; }
}

#175031
Feb 09, 2017 17:44
Vote:
 

Figured this out - I was using metafield name 'icontent_name". It should be the property name "PageName" and that fixed it!

#175091
Feb 10, 2017 17:19
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.