Hello, I need to make an inbuilt cms property (Name property) non-culture specific and I followed Per'sinstructure here - http://world.episerver.com and it works fine , except the [Ignore] attribute to set the old value to new.
The issue with Ignore attribute (below) is that the value of the index variable is always Pageshortcutype and something else and it never is any attribute name . I have below code in the same class where I have my new overriding property ( classname: PageData)
It does what I need except I need the value of the property(Name/icontent_name) in master language to reflect in all other languages. How can I achieve this?
I think if I can fix the [Ignore] part mentioned in Per's link, that might fix this .
Hello, I need to make an inbuilt cms property (Name property) non-culture specific and I followed Per'sinstructure here - http://world.episerver.com and it works fine , except the [Ignore] attribute to set the old value to new.
The issue with Ignore attribute (below) is that the value of the index variable is always Pageshortcutype and something else and it never is any attribute name . I have below code in the same class where I have my new overriding property ( classname: PageData)
//[Ignore]
//public override object this[string index]
//{
// get
// {
// if (index == "icontent_name")
// {
// return SiteName;
// }
// return base[index];
// }
// set { base[index] = value; }
//}
So I went in a different route and did something like this -
public void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
{
foreach (var modelMetadata in metadata.Properties)
{
var property = (ExtendedMetadata)modelMetadata;
if(property.PropertyName == "icontent_name" && property.ContainerType.Name == "BrandingSettingsPageType" && !string.Equals(ContentLanguage.PreferredCulture.Name, c_defaultLanguage, StringComparison.CurrentCultureIgnoreCase))
{
property.ShowForEdit = false;
}
}
}
It does what I need except I need the value of the property(Name/icontent_name) in master language to reflect in all other languages. How can I achieve this?
I think if I can fix the [Ignore] part mentioned in Per's link, that might fix this .
Any thoughts?