private void BindWidget() { if (!string.IsNullOrEmpty(Title)) { this.titleLbl.Text = Title; if (this.titleLbl.Text.StartsWith("<span")) { this.titleLbl.CssClass = "stronger overlay-c"; } } if (!string.IsNullOrEmpty(SubTitle)) { this.subTitleLtl.Text = SubTitle; } if (!string.IsNullOrEmpty(FirstBtnText)) { this.AddButton(this.btnParagraph, FirstBtnText, FirstBtnLandingPage, FirstBtnExternalLink); } if (!string.IsNullOrEmpty(SecondBtnText)) { this.AddButton(this.btnParagraph, SecondBtnText, SecondBtnLandingPage, SecondBtnExternalLink); } if (BackgroundImageId != null && BackgroundImageId != Guid.Empty) { this.bgrImage.ImageUrl = LibrariesUtilities.GetMediaUrlByImageId(BackgroundImageId, true); } }
private void ProductsList_PreRender(object sender, EventArgs e) { Image backgroundImg = this.productsList.FindControl("BackgroundImg") as Image; if (backgroundImg != null && BackgroundImageId != null && BackgroundImageId != Guid.Empty) { backgroundImg.ImageUrl = LibrariesUtilities.GetMediaUrlByImageId(this.BackgroundImageId, true); backgroundImg.AlternateText = LibrariesUtilities.GetAltByImageId(this.BackgroundImageId); } }
private void PopulateLogosList() { if (AlbumId != null && AlbumId != Guid.Empty) { var logos = LibrariesUtilities.GetImagesByAlbumNativeAPI(AlbumId); if (logos != null) { this.companiesLogosList.ItemDataBound += CompaniesLogosList_ItemDataBound; this.companiesLogosList.DataSource = logos; this.companiesLogosList.DataBind(); } } }
private void CompaniesLogosList_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e) { if (e.Item is RadListViewDataItem) { var image = ((RadListViewDataItem)e.Item).DataItem as Telerik.Sitefinity.Libraries.Model.Image; string imageUrl = LibrariesUtilities.GetMediaUrlByImageId(image.Id, true); if (!string.IsNullOrEmpty(imageUrl)) { Image imageControl = e.Item.FindControl("logoImg") as Image; imageControl.ImageUrl = imageUrl; imageControl.AlternateText = image.AlternativeText; } } }
private void SetBackgroundImage() { if (BackgroundImageId != null && BackgroundImageId != Guid.Empty) { this.articleWrapper.Attributes["class"] = ContactUs.articleWrapperBackgroundClass; if (this.backgrdImage != null) { var imageUrl = LibrariesUtilities.GetMediaUrlByImageId(this.BackgroundImageId, true); this.backgrdImage.ImageUrl = imageUrl; this.backgrdImage.AlternateText = LibrariesUtilities.GetAltByImageId(this.BackgroundImageId); if (this.backgrdFigure != null) { this.backgrdFigure.Attributes["style"] = string.Format(@"background-image: url('{0}');", imageUrl); } } } else { this.backgrdFigure.Visible = false; } }
private void BindWidget() { if (!string.IsNullOrEmpty(this.Title)) { var titleControl = this.CreateTitle(this.Title); this.divWrapper.Controls.AddAt(0, titleControl); } if (!string.IsNullOrEmpty(this.Content)) { this.ContentLtl.Text = this.Content; } if (this.Image != null && this.Image != Guid.Empty) { this.ImageControl.ImageUrl = LibrariesUtilities.GetMediaUrlByImageId(this.Image, true); this.ImageControl.AlternateText = LibrariesUtilities.GetAltByImageId(this.Image); } if (!string.IsNullOrEmpty(this.ImageAlignment)) { if (this.ImageAlignment == "Left") { this.imageWrapper.Attributes.Add("class", leftAlignmentCSSClass); } else { this.imageWrapper.Attributes.Add("class", rightAlignmentCSSClass); } } if (!string.IsNullOrEmpty(this.TextBackgroundColor)) { if (this.TextBackgroundColor == "White") { this.contentWrapper.Style.Add("background-color", whiteBGRColorName); this.contentWrapper.Style.Add("padding", contentWrapperPaddingStyle); } } }