public MetaData(IPublishedContent content) { MetaTitle = content.HasValue(Constants.SkyConstants.Properties.SeoTitle) && !string.IsNullOrEmpty(content.GetPropertyValue <string>(Constants.SkyConstants.Properties.SeoTitle)) ? content.GetPropertyValue <string>(Constants.SkyConstants.Properties.SeoTitle) : (content.HasValue(Constants.SkyConstants.Properties.Title) && !string.IsNullOrEmpty(content.GetPropertyValue <string>(Constants.SkyConstants.Properties.Title)) ? content.GetPropertyValue <string>("title") : content.Name); MetaTitle = MetaTitle.Replace("*", "") + " - " + SkyContext.Current.Site.Content.GetPropertyValue <string>(Constants.SkyConstants.Properties.SiteName); MetaDescription = content.HasValue(Constants.SkyConstants.Properties.SeoMetaDescription) && !string.IsNullOrEmpty(content.GetPropertyValue <string>(Constants.SkyConstants.Properties.SeoMetaDescription)) ? content.GetPropertyValue <string>(Constants.SkyConstants.Properties.SeoMetaDescription) : (content.HasValue(Constants.SkyConstants.Properties.Teaser) && !string.IsNullOrEmpty(content.GetPropertyValue <string>(Constants.SkyConstants.Properties.Teaser)) ? content.GetPropertyValue <string>(Constants.SkyConstants.Properties.Teaser) : ""); HideFromSearch = content.HasProperty(Constants.SkyConstants.Properties.HideFromSearch) && content.GetPropertyValue <bool>(Constants.SkyConstants.Properties.HideFromSearch); }
public SkyMaster(IPublishedContent content) { Content = content; MetaTitle = content.HasValue("seoTitle") && !string.IsNullOrEmpty(content.GetPropertyValue <string>("seoTitle")) ? content.GetPropertyValue <string>("seoTitle") : (content.HasValue("title") && !string.IsNullOrEmpty(content.GetPropertyValue <string>("title")) ? content.GetPropertyValue <string>("title") : content.Name); MetaTitle = MetaTitle.Replace("*", ""); MetaDescription = content.HasValue("seoMetaDescription") && !string.IsNullOrEmpty(content.GetPropertyValue <string>("seoMetaDescription")) ? content.GetPropertyValue <string>("seoMetaDescription") : (content.HasValue("teaser") && !string.IsNullOrEmpty(content.GetPropertyValue <string>("teaser")) ? content.GetPropertyValue <string>("teaser") : ""); HideFromNavigation = content.GetPropertyValue <bool>("umbracoNaviHide"); HideFromSearch = content.HasProperty("hideFromSearch") && content.GetPropertyValue <bool>("hideFromSearch"); }