protected void Page_Load(object sender, EventArgs e) { AddPoweredBy(); if (!Page.IsPostBack) { CheckAffiliate(); } string defaulSEOTitle = SettingManager.GetSettingValue("SEO.DefaultTitle"); string defaulSEODescription = SettingManager.GetSettingValue("SEO.DefaultMetaDescription"); string defaulSEOKeywords = SettingManager.GetSettingValue("SEO.DefaultMetaKeywords"); SEOHelper.RenderTitle(this.Page, defaulSEOTitle, false, false); SEOHelper.RenderMetaTag(this.Page, "description", defaulSEODescription, false); SEOHelper.RenderMetaTag(this.Page, "keywords", defaulSEOKeywords, false); if (SettingManager.GetSettingValueBoolean("Display.ShowNewsHeaderRssURL")) { SEOHelper.RenderHeaderRSSLink(this.Page, defaulSEOTitle + ": News", SEOHelper.GetNewsRssURL()); } if (SettingManager.GetSettingValueBoolean("Display.ShowBlogHeaderRssURL")) { SEOHelper.RenderHeaderRSSLink(this.Page, defaulSEOTitle + ": Blog", SEOHelper.GetBlogRssURL()); } }
private void OverRideSEOInfo(string itemSKU, int storeID, int portalID, string userName, string cultureName) { ItemSEOInfo dtItemSEO = GetSEOSettingsBySKU(itemSKU, storeID, portalID, userName, cultureName); if (dtItemSEO != null) { itemID = int.Parse(dtItemSEO.ItemID.ToString()); itemName = dtItemSEO.Name.ToString(); string PageTitle = dtItemSEO.MetaTitle.ToString(); string PageKeyWords = dtItemSEO.MetaKeywords.ToString(); string PageDescription = dtItemSEO.MetaDescription.ToString(); if (!string.IsNullOrEmpty(PageTitle)) { SEOHelper.RenderTitle(this.Page, PageTitle, false, true, this.GetPortalID); } if (!string.IsNullOrEmpty(PageKeyWords)) { SEOHelper.RenderMetaTag(this.Page, "KEYWORDS", PageKeyWords, true); } if (!string.IsNullOrEmpty(PageDescription)) { SEOHelper.RenderMetaTag(this.Page, "DESCRIPTION", PageDescription, true); } } }
protected void Page_Load(object sender, EventArgs e) { if (manufacturer == null || manufacturer.Deleted || !manufacturer.Published) { Response.Redirect(CommonHelper.GetStoreLocation()); } //title, meta string title = string.Empty; if (!string.IsNullOrEmpty(manufacturer.LocalizedMetaTitle)) { title = manufacturer.LocalizedMetaTitle; } else { title = manufacturer.LocalizedName; } SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", manufacturer.LocalizedMetaDescription, true); SEOHelper.RenderMetaTag(this, "keywords", manufacturer.LocalizedMetaKeywords, true); //canonical URL if (SEOHelper.EnableUrlRewriting && this.SettingManager.GetSettingValueBoolean("SEO.CanonicalURLs.Manufacturer.Enabled")) { if (!this.SEName.Equals(SEOHelper.GetManufacturerSEName(manufacturer))) { string canonicalUrl = SEOHelper.GetManufacturerUrl(manufacturer); if (this.Request.QueryString != null) { for (int i = 0; i < this.Request.QueryString.Count; i++) { string key = Request.QueryString.GetKey(i); if (!String.IsNullOrEmpty(key) && (key.ToLowerInvariant() != "manufacturerid") && (key.ToLowerInvariant() != "sename")) { canonicalUrl = CommonHelper.ModifyQueryString(canonicalUrl, key + "=" + Request.QueryString[i], null); } } } SEOHelper.RenderCanonicalTag(Page, canonicalUrl); } } if (!Page.IsPostBack) { NopContext.Current.LastContinueShoppingPage = CommonHelper.GetThisPageUrl(true); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); } Topic topic = TopicManager.GetTopicByID(this.TopicID); string title = CommonHelper.IIF(!string.IsNullOrEmpty(topic.MetaTitle), topic.MetaTitle ?? String.Empty, topic.Name ?? String.Empty); SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", topic.MetaDescription ?? String.Empty, true); SEOHelper.RenderMetaTag(this, "keywords", topic.MetaKeywords ?? String.Empty, true); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CommonHelper.EnsureNonSSL(); } if (manufacturer == null || manufacturer.Deleted || !manufacturer.Published) { Response.Redirect("~/Default.aspx"); } string title = CommonHelper.IIF(!string.IsNullOrEmpty(manufacturer.MetaTitle), manufacturer.MetaTitle, manufacturer.Name); SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", manufacturer.MetaDescription, true); SEOHelper.RenderMetaTag(this, "keywords", manufacturer.MetaKeywords, true); }
protected void Page_Load(object sender, EventArgs e) { if (category == null || category.Deleted || !category.Published) { Response.Redirect(CommonHelper.GetStoreLocation()); } string title = string.Empty; if (!string.IsNullOrEmpty(category.MetaTitle)) { title = category.MetaTitle; } else { title = category.Name; } SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", category.MetaDescription, true); SEOHelper.RenderMetaTag(this, "keywords", category.MetaKeywords, true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (this.Topic != null) { //title string title = this.Topic.MetaTitle; if (String.IsNullOrEmpty(title)) { title = this.Topic.Title; } if (!string.IsNullOrEmpty(title)) { SEOHelper.RenderTitle(this.Page, title, true); } //meta SEOHelper.RenderMetaTag(this.Page, "description", this.Topic.MetaDescription, true); SEOHelper.RenderMetaTag(this.Page, "keywords", this.Topic.MetaKeywords, true); } }
protected void Page_Load(object sender, EventArgs e) { if (product == null || product.Deleted) { Response.Redirect(CommonHelper.GetStoreLocation()); } //title, meta string title = string.Empty; if (!string.IsNullOrEmpty(product.LocalizedMetaTitle)) { title = product.LocalizedMetaTitle; } else { title = product.LocalizedName; } SEOHelper.RenderTitle(this, title, true); SEOHelper.RenderMetaTag(this, "description", product.LocalizedMetaDescription, true); SEOHelper.RenderMetaTag(this, "keywords", product.LocalizedMetaKeywords, true); //canonical URL if (SEOHelper.EnableUrlRewriting && this.SettingManager.GetSettingValueBoolean("SEO.CanonicalURLs.Products.Enabled")) { if (!this.SEName.Equals(SEOHelper.GetProductSEName(product))) { string canonicalUrl = SEOHelper.GetProductUrl(product); SEOHelper.RenderCanonicalTag(Page, canonicalUrl); } } if (!Page.IsPostBack) { this.ProductService.AddProductToRecentlyViewedList(product.ProductId); } }