public virtual Article ToLiquidArticle(StorefrontModel.BlogArticle article) { var retVal = new Article(); retVal.Author = article.Author; retVal.Category = article.Category; retVal.Content = article.Content; retVal.Description = article.Description; retVal.Excerpt = article.Excerpt; retVal.ImageUrl = article.ImageUrl; retVal.IsSticked = article.IsSticked; retVal.IsTrending = article.IsTrending; retVal.Priority = article.Priority; retVal.Title = article.Title; retVal.Type = article.Type; retVal.Url = article.Url; retVal.Handle = article.Url; retVal.CreatedAt = article.CreatedDate; retVal.PublishedAt = article.PublishedDate ?? article.CreatedDate; retVal.Tags = article.Tags != null?article.Tags.OrderBy(t => t).Select(t => t.Handelize()).ToArray() : null; retVal.Comments = new MutablePagedList <Comment>(new List <Comment>()); if (article.Category != null) { retVal.Category = article.Category.Handelize(); } return(retVal); }
public static ContentItem GetContentItemFromPath(string path) { ContentItem retVal = null; if (!string.IsNullOrEmpty(path)) { //Blog var blogMatch = _blogMatchRegex.Match(path); if (blogMatch.Success) { var blogName = blogMatch.Groups["blog"].Value; var fileName = Path.GetFileNameWithoutExtension(path); if (fileName.ToLower() == "default") { retVal = new Blog() { Name = blogName, }; } else { retVal = new BlogArticle() { BlogName = blogName }; } } else { retVal = new ContentPage(); } } return retVal; }
public static Article ToShopifyModel(this StorefrontModel.BlogArticle article) { var retVal = new Article(); retVal.InjectFrom <NullableAndEnumValueInjecter>(article); retVal.CreatedAt = article.CreatedDate; retVal.PublishedAt = article.PublishedDate ?? article.CreatedDate; return(retVal); }
public static Article ToShopifyModel(this StorefrontModel.BlogArticle article) { var retVal = new Article(); retVal.InjectFrom <NullableAndEnumValueInjecter>(article); retVal.Handle = article.Url; retVal.CreatedAt = article.CreatedDate; retVal.PublishedAt = article.PublishedDate ?? article.CreatedDate; retVal.Tags = article.Tags != null?article.Tags.OrderBy(t => t).ToArray() : null; retVal.Comments = new MutablePagedList <Comment>(new List <Comment>()); retVal.Category = article.Category; return(retVal); }
public virtual Article ToLiquidArticle(StorefrontModel.BlogArticle article) { var retVal = new Article(); retVal.InjectFrom <NullableAndEnumValueInjecter>(article); retVal.Handle = article.Url; retVal.CreatedAt = article.CreatedDate; retVal.PublishedAt = article.PublishedDate ?? article.CreatedDate; retVal.Tags = article.Tags != null?article.Tags.OrderBy(t => t).Select(t => t.Handelize()).ToArray() : null; retVal.Comments = new MutablePagedList <Comment>(new List <Comment>()); if (article.Category != null) { retVal.Category = article.Category.Handelize(); } return(retVal); }
public static Article ToShopifyModel(this StorefrontModel.BlogArticle article) { var converter = new ShopifyModelConverter(); return(converter.ToLiquidArticle(article)); }
public static Article ToShopifyModel(this StorefrontModel.BlogArticle article) { var converter = ServiceLocator.Current.GetInstance <ShopifyModelConverter>(); return(converter.ToLiquidArticle(article)); }