public static string GetProperty(this IUwebshopUmbracoEntity content, string propertyAlias) { IProperty property = new Node(content.Id).GetMultiStoreItem(propertyAlias); if (property == null) { return(string.Empty); } return(property.Value); }
internal static string BuildUrlFromTemplate(string productUrl, IUwebshopUmbracoEntity entity) { if (string.IsNullOrEmpty(productUrl)) { return(null); } var productUrlPropertyAliasses = productUrl.Split(','); var urlFormat = string.Empty; foreach (var productUrlPropertyAlias in productUrlPropertyAliasses) { if (productUrlPropertyAlias.StartsWith("#")) { urlFormat += productUrlPropertyAlias.Skip(1); } else { urlFormat += StoreHelper.GetMultiStoreItem(entity.Id, productUrlPropertyAlias); // todo: this creates extra examine queries } } return(urlFormat); }