Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
You could modify your language files in order to do that I think
<languages> <language name="English" id="en"> <contenttypes> <mycontenttype> <properties> <icontent_name> <caption>My special name</caption> <help>My really helpful help</help> </icontent_name> </properties> </mycontenttype>
...
Thanks for the reply, Per! That's what I'm doing today, but I wanted to be able to do it with an attribute on the content type. And also I'm just curious if it can be done. :P
Actually, I'm pretty sure that I investigated this a few weeks back and came to the conslusion that changing the DiplayName property on the metadata has no effect. The reason for this is that the language settings for the content type is applied over the metadata in the view, so they way to go is probably to modify this through the language files.
I'm trying to change the name and tooltip for the Name property of specific content types.
I'm able to change other types of meta data, for example to hide native properties in the UI, but I can't seem to do it for the Name property.
My code looks like the following:
public void ModifyMetadataForNameProperty(ExtendedMetadata metadata, IEnumerable attributes)
{
var nameProperty = metadata.Properties.OfType()
.FirstOrDefault(prop =>
prop.OwnerContent is MyContentType &&
prop.PropertyName == "icontent_name");
// Here I have the Name property, populated with the default meta data
if (nameProperty != null)
{
nameProperty.DisplayName = "Custom name";
nameProperty.ShortDisplayName = "Name";
nameProperty.EditorConfiguration["tooltip"] = "This should be the new tooltip for the Name property for MyContentType instances";
}
}
Any clever ideas are much appreciated! :)