Created
February 5, 2015 19:10
-
-
Save ncelico/25b939b4fe7d647e6431 to your computer and use it in GitHub Desktop.
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 hidden or 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