Try our conversational search powered by Generative AI!

Make the inbuilt CMS property "Name" to culturespecific(false)

Vote:
 

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?

#174842
Edited, Feb 06, 2017 22:42
Vote:
 

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

#175092
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.