public static SeoKeyword AsWebModel(this Data.SeoKeyword keyword)
        {
            var ret = new SeoKeyword();

            ret.InjectFrom(keyword);
            return(ret);
        }
Beispiel #2
0
        /// <summary>
        ///     Builds the outline for category.
        ///     Key - categoryId
        ///     Value - semantic url
        /// </summary>
        /// <param name="collection">The category.</param>
        /// <param name="language">The language.</param>
        /// <returns></returns>
        public static Dictionary <string, string> BuildOutline(this Collection collection, string language = null)
        {
            var segments = new Dictionary <string, string>();

            //first add parents
            if (collection.Parents != null)
            {
                foreach (var parent in collection.Parents)
                {
                    SeoKeyword keyword = null;
                    if (parent.Keywords != null)
                    {
                        keyword = parent.Keywords.SeoKeyword(language);
                    }

                    segments.Add(parent.Id, keyword != null ? keyword.Keyword : parent.Handle);
                }
            }

            //Finally add category itself
            {
                var keyword = collection.Keywords != null?collection.Keywords.SeoKeyword(language) : null;

                segments.Add(collection.Id, keyword != null ? keyword.Keyword : collection.Handle);
            }

            return(segments);
        }
Beispiel #3
0
        protected virtual void SetPageMeta(SeoKeyword keyword)
        {
            if (keyword == null)
            {
                return;
            }

            var ctx = SiteContext.Current;

            ctx.PageDescription = keyword.MetaDescription;
            ctx.PageTitle       = keyword.Title;
            ctx.PageKeywords    = keyword.MetaKeywords;
        }
 public static SeoKeyword AsWebModel(this Data.SeoKeyword keyword)
 {
     var ret = new SeoKeyword();
     ret.InjectFrom(keyword);
     return ret;
 }