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
private static string SanitizeForCSV(string s) | |
{ | |
const string QUOTE = "\""; | |
const string ESCAPED_QUOTE = "\"\""; | |
char[] CHARACTERS_THAT_MUST_BE_QUOTED = { ',', '"', '\n' }; | |
if (s == null) | |
return string.Empty; | |
if (s.Contains(QUOTE)) |
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(); | |
} |
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
<div class="sitecore-form"> | |
<div> | |
<label>Name</label> | |
</div> | |
<div> | |
<sc:Text runat="server" Field="Name" /> | |
</div> | |
<div> | |
<label>Title</label> |
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
using System; | |
namespace YourCompany.Extension | |
{ | |
public static class PrettyDate | |
{ | |
public static String GetPrettyDate(this DateTime date) | |
{ | |
// 1. | |
// Get time span elapsed since the date. |