Esempio n. 1
0
        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"]);
Esempio n. 2
0
 /// <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"])
     };
 }
Esempio n. 3
0
 /// <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"])
     };
 }
Esempio n. 4
0
 /// <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"])
     };
 }
Esempio n. 5
0
 /// <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"])
     };
 }