Modify Created Date of item in sitecore. Handy when you have items ordered by date and you want one to switch places
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var itemToHack = Sitecore.Context.Database.GetItem("/sitecore/content/YouPath"); | |
using (new Sitecore.SecurityModel.SecurityDisabler()) | |
{ | |
itemToHack.Editing.BeginEdit(); | |
itemToHack[Sitecore.FieldIDs.Created] = Sitecore.DateUtil.ToIsoDate(DateTime.MinValue); | |
itemToHack.Editing.EndEdit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment