public void Process(PopulateScribanMailActionModelArgs args) { EntryItem entryItem = null; CommentItem commentItem = null; var dataItem = args.WorkflowPipelineArgs.DataItem; if (_templateManager.TemplateIsOrBasedOn(dataItem, _settings.EntryTemplateIds)) { entryItem = new EntryItem(args.WorkflowPipelineArgs.DataItem); } else if (_templateManager.TemplateIsOrBasedOn(dataItem, _settings.CommentTemplateIds)) { commentItem = new CommentItem(args.WorkflowPipelineArgs.DataItem); entryItem = _entryManager.GetBlogEntryItemByCommentUri(commentItem.InnerItem.Uri); } if (args.EntryItem == null && entryItem != null) { args.EntryItem = entryItem; } if (args.CommentItem == null && commentItem != null) { args.CommentItem = commentItem; } }
public override object ComputeFieldValue(IIndexable indexable) { var indexableItem = indexable as SitecoreIndexableItem; if (indexableItem == null) { return(null); } var entryItem = EntryManager.GetBlogEntryItemByCommentUri(indexableItem.Item.Uri); return(entryItem?.InnerItem.Uri); }