Beispiel #1
0
        /// <summary>
        /// Gets the current page node and converts the pages to css classes, useful on the body element to style a specific page
        /// </summary>
        /// <returns></returns>
        public static string GetCurrentPageNodeAsClasses()
        {
            string css         = String.Empty;
            var    currentPage = SitefinitySiteMap.GetActualCurrentNode();

            if (currentPage != null)
            {
                css = " " + currentPage.Url.TrimStart('~', '/').Replace("'", "").Replace("<", "").Replace(">", "").Replace("\"", "").Replace("/", " ");
            }

            return(css);
        }