public static bool HasPageHeroImage(this IPageHeroComposition composition)
        {
            if (composition.HeroImage == null)
            {
                return(false);
            }

            return(string.IsNullOrEmpty(composition.HeroImage.Url) == false);
        }
        public static string GetHeadline(this IPageHeroComposition content)
        {
            var names = new string[]
            {
                content.Headline,
                content.Name
            };

            return(names.FirstOrDefault(x => string.IsNullOrWhiteSpace(x) == false));
        }
        private PageHeroViewModel GetPageHeroViewModel(IPageHeroComposition pageHeroComposition)
        {
            if (pageHeroComposition.HeroImage == null)
            {
                return(null);
            }

            var headline = string.IsNullOrWhiteSpace(pageHeroComposition.Headline) == false ?
                           pageHeroComposition.Headline
                           : pageHeroComposition.Name;

            return(new PageHeroViewModel()
            {
                Headline = headline,
                ImageUrl = pageHeroComposition.HeroImage.Url,
                ImageCopyrightText = pageHeroComposition.HeroImage.GetPropertyValue <string>("titleText"),
            });
        }
 /// <summary>Static getter for Hero Image</summary>
 public static IPublishedContent GetHeroImage(IPageHeroComposition that)
 {
     return(that.GetPropertyValue <IPublishedContent>("heroImage"));
 }
 /// <summary>Static getter for Headline</summary>
 public static string GetHeadline(IPageHeroComposition that)
 {
     return(that.GetPropertyValue <string>("headline"));
 }