public override void Process(ReplaceFieldValueTokensArgs args)
        {
            DateTime dateToUse;

            try
            {
                dateToUse = Sitecore.Configuration.State.Previewing
                    ? Sitecore.Configuration.State.PreviewDate
                    : DateTime.Now;
            }
            catch
            {
                dateToUse = DateTime.Now;
            }
            args.FieldValue = ReplaceTokenWithOptionalFormat(args.FieldValue, "Now", dateToUse);
        }
示例#2
0
        public override void Process(ReplaceFieldValueTokensArgs args)
        {
            if (args.Item == null)
            {
                return;
            }

            args.FieldValue = ReplaceTokenWithOptionalFormat(args.FieldValue, "DisplayName", args.Item.DisplayName);

            args.FieldValue = ReplaceTokenWithOptionalFormat(args.FieldValue, "Updated", args.Item.Statistics.Updated);
            args.FieldValue = ReplaceTokenWithOptionalFormat(args.FieldValue, "UpdatedBy", args.Item.Statistics.UpdatedBy);

            args.FieldValue = ReplaceTokenWithOptionalFormat(args.FieldValue, "Created", args.Item.Statistics.Created);
            args.FieldValue = ReplaceTokenWithOptionalFormat(args.FieldValue, "CreatedBy", args.Item.Statistics.CreatedBy);

            args.FieldValue = ReplaceFieldValueTokens(args.FieldValue, args.Item);
        }
 public abstract void Process(ReplaceFieldValueTokensArgs args);