Exemple #1
0
        public static bool IsCaseStudy(this PageNode page)
        {
            // Fix for SF Revision History system
            if (page == null)
            {
                return(false);
            }

            var contentType = page.GetValue("PageContentType");

            return(contentType != null && contentType.ToString() == "Case Study");
        }
        /// <summary>
        /// Gets the keyword
        /// </summary>
        /// <param name="page">From page</param>
        /// <returns>string keyword</returns>
        private string GetPageKeyword(PageNode page)
        {
            //Check for SEO keyword field
            string keywordFieldName = config.Modules.Yoast.KeywordFieldName;

            try
            {
                object keywordObject = page.GetValue(keywordFieldName);
                return(keywordObject == null ? "" : keywordObject.ToString());
            }
            catch
            {
                return(String.Empty);
            }
        }
Exemple #3
0
        public string GetCustomField(PageNode pageNode, string customFieldName)
        {
            var customField = pageNode.GetValue(customFieldName) as Lstring;

            return(customField.Value);
        }
Exemple #4
0
 public static bool ShowSecondaryNav(this PageNode page)
 {
     // Fix for SF Revision History system - page != null
     return(page != null && page.GetValue <bool>("ShowSecondaryNav"));
 }