/// <summary> /// Get the Source /// </summary> /// <returns> /// The Source String <see cref="string"/>. /// </returns> protected override string GetSource() { var baseUrl = new Sitecore.Text.UrlString(base.GetSource().Replace("&", "&")); if (Parameters.ContainsKey("useCustomFunctions")) { baseUrl.Add("useCustomFunctions", Parameters["useCustomFunctions"]); // remove useNamicsFuctions from the parameters dictionary so it's not added as an attribute on the img tag Parameters.Remove("useCustomFunctions"); } if (Parameters.ContainsKey("centerCrop")) { baseUrl.Add("centerCrop", Parameters["centerCrop"]); // remove centerCrop from the parameters dictionary so it's not added as an attribute on the img tag Parameters.Remove("centerCrop"); } if (Parameters.ContainsKey("cropX") && Parameters.ContainsKey("cropY")) { baseUrl.Add("cropX", Parameters["cropX"]); baseUrl.Add("cropY", Parameters["cropY"]); // remove cropStartX, cropStartY, cropWidth and cropHeight from the parameters dictionary so they not added as attributes on the img tag Parameters.Remove("cropX"); Parameters.Remove("cropY"); } if (Parameters.ContainsKey("keepOrientation")) { baseUrl.Add("keepOrientation", Parameters["keepOrientation"]); // remove keepOrientation from the parameters dictionary so it's not added as an attribute on the img tag Parameters.Remove("keepOrientation"); } if (Parameters.ContainsKey("greyScale")) { baseUrl.Add("greyScale", Parameters["greyScale"]); // remove greyScale from the parameters dictionary so it's not added as an attribute on the img tag Parameters.Remove("greyScale"); } if (Parameters.ContainsKey("rotateFlip")) { baseUrl.Add("rotateFlip", Parameters["rotateFlip"]); // remove rotateFlip from the parameters dictionary so it's not added as an attribute on the img tag Parameters.Remove("rotateFlip"); } return(baseUrl.GetUrl(Xhtml && Settings.Rendering.ImagesAsXhtml)); }
protected string GetCampaignQueryString() { var options = _linkManager.GetDefaultUrlOptions(); options.AlwaysIncludeServerUrl = true; string itemUrl = _linkManager.GetItemUrl(_pageContext.Item, options); var urlString = new Sitecore.Text.UrlString(itemUrl); var campaignId = GetCamapignId(); if (!campaignId.IsNull) { urlString.Add("sc_camp", campaignId.ToShortID().ToString()); } return urlString.GetUrl(); }