I do not know it there are any way to say that the editor should not be able to update this, but still be able to publish the page.
What you can do is to hide them with css, just add this to a css that are included in the edit mode
a[name="ichangetrackable_created"] { display: none; } a[name="iversionable_startpublish"] { display: none; }
Read more here on how to create such a css-file (you do not need the things Alf puts in his, just the code I wrote, but the things Alf do in this blog post is great)
http://talk.alfnilsson.se/2014/12/18/display-help-text-in-on-page-editing/
God luck!
Hi Mark,
maybe this class can help?
var tabDefinitionRepository = ServiceLocator.Current.GetInstance<ITabDefinitionRepository>();
We have used this initialization module to add this piece of code:
private static void AddTabToList(ITabDefinitionRepository tabDefinitionRepository, TabDefinition definition) { var existingTab = GetExistingTabDefinition(tabDefinitionRepository, definition); if (existingTab != null) { definition.ID = existingTab.ID; } tabDefinitionRepository.Save(definition); } private static TabDefinition GetExistingTabDefinition(ITabDefinitionRepository tabDefinitionRepository, TabDefinition definition) { return tabDefinitionRepository .List() .FirstOrDefault(t => t.Name.Equals(definition.Name, StringComparison.InvariantCultureIgnoreCase)); }
And than call this by:
AddTabToList(tabDefinitionRepository, new TabDefinition { Name = SystemTabNames.Content, RequiredAccess = AccessLevel.Edit, SortIndex = 1 });
I hope it helps! :)
Thanks Henrik/Simona,
I'm not sure that either approach works for me. I would like to change the label of the Published field to "To be published on" while leaving it editable. For the Created field I have been able to make this read only by overriding the Created Property and adding an Editable(false) attribute. Strangely, for Created, if I set a name and description in the Display attribute these get ignored and the default values are used.
Mark
A third way that should be possible is to implement an IMetadataExtender.
See Kalle Ljungs blog for some sample code, http://world.episerver.com/blogs/Kalle-Ljung/Dates/2013/10/Moving-built-in-properties-to-the-settings-header-in-EPiServer-7-CMS/.
Regards
Per Gunsarfs
If you just need to change the label, you could add this to one of your languages files:
<languages> <language name="English" id="en"> <contenttypes> <icontentdata> <properties> <iversionable_startpublish> <caption>Published or whatever</caption> </iversionable_startpublish> </properties> </icontentdata>
...
For the "Created" property, I think you can use:
<ichangetrackable_created> <caption>Created</caption> <help>Description goes here </help> </ichangetrackable_created>
To change the description etc the method described by Per works great. To hide a property from the editor, or make it readonly then an EditorDescriptor can be used e.g.
[EditorDescriptorRegistration(TargetType = typeof(DateTime?))] public class EPiServerDateFieldEditorDescriptor : EditorDescriptor { public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes) { if (metadata.PropertyName == "ichangetrackable_created") { metadata.IsReadOnly = true; //metadata.ShowForEdit = false; } base.ModifyMetadata(metadata, attributes); } }
If you are working with EPiServer 7.5, there is a simplified version on how to move built in properties as part of this sample project on GitHub:
Hi,
Does anyone know if it's possible to hook into the built in properties Published and Created on the settings tab at all? I'm interested in either removing, disabling editing of these or changing the value of the labels.
so far I've not found if this is possible so any pointers would be much appreciated.
Thanks,
Mark