Beispiel #1
0
 public static ContentTypeKeys Instance()
 {
     if (_instance == null)
     {
         lock (lockObject)
         {
             if (_instance == null)
             {
                 _instance = new ContentTypeKeys();
             }
         }
     }
     return(_instance);
 }
Beispiel #2
0
        /// <summary>
        /// 资讯详细显示页
        /// </summary>
        public static string ContentItemDetail(this SiteUrls siteUrls, long contentItemId)
        {
            var contentItemService = new ContentItemService();
            var item = contentItemService.Get(contentItemId);

            if (item == null)
            {
                return(string.Empty);
            }
            if (item.ContentType != null && item.ContentType.ContentTypeKey == ContentTypeKeys.Instance().NewsLink())
            {
                return(item.AdditionalProperties.Get <string>("LinkUrl", string.Empty));
            }

            RouteValueDictionary routeValueDictionary = new RouteValueDictionary();

            routeValueDictionary.Add("contentItemId", contentItemId);

            return(CachedUrlHelper.Action("ContentItemDetail", "ChannelCms", CmsAreaName, routeValueDictionary));
        }