public static (Cms.Content, string) GetContentFor(TableRow row) { var content = new Cms.Content { Id = SpecHelpers.PerformSubstitutions(row["Id"]), Author = new Cms.CmsIdentity(SpecHelpers.PerformSubstitutions(row["Author.Id"]), SpecHelpers.PerformSubstitutions(row["Author.Name"])), Culture = CultureInfo.GetCultureInfo(SpecHelpers.PerformSubstitutions(row["Culture"])), Description = SpecHelpers.PerformSubstitutions(row["Description"]), Slug = SpecHelpers.PerformSubstitutions(row["Slug"]), Title = SpecHelpers.PerformSubstitutions(row["Title"]), }; content.CategoryPaths.AddRange(SplitAndTrim(SpecHelpers.PerformSubstitutions(row["CategoryPaths"]))); content.Tags.AddRange(SplitAndTrim(SpecHelpers.PerformSubstitutions(row["Tags"]))); return(content, row["Name"]);
/// <summary> /// Sets a Liquid with markdown payload on a content instance. /// </summary> /// <param name="content">The content instance on which to set the payload.</param> /// <param name="row">The row from which to get the markdown.</param> public static void SetContentLiquidMarkdown(Cms.Content content, TableRow row) { content.ContentPayload = new LiquidWithMarkdownPayload { Template = SpecHelpers.PerformSubstitutions(row["Liquid with markdown template"]) }; }
/// <summary> /// Sets a content workflow payload on a content instance. /// </summary> /// <param name="content">The content instance on which to set the payload.</param> /// <param name="row">The row from which to get the slug for the workflow content.</param> public static void SetContentWorkflow(Cms.Content content, TableRow row) { content.ContentPayload = new PublicationWorkflowContentPayload { Slug = SpecHelpers.PerformSubstitutions(row["ContentSlug"]) }; }
/// <summary> /// Sets a markdown payload on a content instance. /// </summary> /// <param name="content">The content instance on which to set the payload.</param> /// <param name="row">The row from which to get the markdown.</param> public static void SetContentMarkdown(Cms.Content content, TableRow row) { content.ContentPayload = new MarkdownPayload { Markdown = SpecHelpers.PerformSubstitutions(row["Markdown"]) }; }
/// <summary> /// Sets a content fragment payload on a content instance. /// </summary> /// <param name="content">The content instance on which to set the payload.</param> /// <param name="row">The row from which to get the content fragment.</param> public static void SetContentFragment(Cms.Content content, TableRow row) { content.ContentPayload = new ContentFragmentPayload { Fragment = SpecHelpers.PerformSubstitutions(row["Fragment"]) }; }