/// <summary> /// The crop up extended url. /// </summary> /// <param name="url"> /// The url. /// </param> /// <param name="sizeArgs"> /// The size args. /// </param> /// <param name="additionalVars"> /// The additional query string variables /// </param> /// <returns> /// The full CropUp media item url /// </returns> private static string CropUpExtendedUrl(string url, ImageSizeArguments sizeArgs, string additionalVars = "") { // Check if the url returned by CropUp contains a ? so that the additional variables are appended correctly var cropUpUrl = CropUp.GetUrl(url, sizeArgs); var queryStringSymbol = cropUpUrl.IndexOf('?') == -1 ? "?" : "&"; if (!string.IsNullOrEmpty(additionalVars)) { return(cropUpUrl + queryStringSymbol + additionalVars); } return(cropUpUrl); }
protected string RenderImage() { string img = @"<figure><img src=""{0}"" alt=""{1}"" /></figure>"; string picUrl; if (!string.IsNullOrEmpty(_standardValueItem.PageImage.PictureUrl)) { picUrl = CropUp.GetUrl(_standardValueItem.PageImage.PictureUrl, new ImageSizeArguments { CropAlias = "news" }); return(string.Format(img, picUrl, _standardValueItem.PageImage.AltText)); } return(string.Empty); }
protected string RenderImage(ImageItem imageItem, string cropUpAlias) { string img = @"<img src=""{0}"" alt=""{1}"" />"; string picUrl; if (!string.IsNullOrEmpty(imageItem.PictureUrl)) { picUrl = CropUp.GetUrl(imageItem.PictureUrl, new ImageSizeArguments { CropAlias = cropUpAlias }); return(string.Format(img, picUrl, imageItem.AltText)); } return(string.Empty); }