SEO Keywords does not work in Topics

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anos atrás
If setup keywords and description for each products and topics, this  works only for products
for topics work only general SEO setup(keywords,description)
But we need different keywords for each page
What we need setup for this ?
12 anos atrás
It works fine. But it works only when you open an entire topic page (for example, http://www.yourStore.com/t/aboutus). It'll not work if topic is a part of some other page (for example, home page welcome text)
12 anos atrás
How can we fix this ?
12 anos atrás
1. Open \Presentation\Nop.Web\Views\Topic\TopicBlock.cshtml file
2. Add the following code right after "@using Nop.Web.Models.Topics"
@{
    if (!Model.IsPasswordProtected)
    {
        Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Title);
        Html.AddMetaDescriptionParts(Model.MetaDescription);
        Html.AddMetaKeywordParts(Model.MetaKeywords);
    }
}
12 anos atrás
I don't have  folder presentation
I found file Topic.aspx.cs  in root folder
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.Common.Utils;
namespace NopSolutions.NopCommerce.Web
{
    public partial class TopicPage : BaseNopPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        public override PageSslProtectionEnum SslProtected
        {
            get
            {
                return PageSslProtectionEnum.No;
            }
        }
    }
}
12 anos atrás
My code is for 2.X versions. And you're using 1.X.

1. Open \Modules\Topics.ascx.cs file
2. Copy the following code in BindData method

if (!String.IsNullOrEmpty(this.LocalizedTopic.MetaDescription))
   SEOHelper.RenderMetaTag(this.Page, "description", this.LocalizedTopic.MetaDescription, true);
if (!String.IsNullOrEmpty(this.LocalizedTopic.MetaKeywords))
   SEOHelper.RenderMetaTag(this.Page, "keywords", this.LocalizedTopic.MetaKeywords, true);


P.S. Don't forget to recompile the solution
12 anos atrás
Can I recompile solution on hosting ?
I am php-developer and this project not my :/
12 anos atrás
No. You need Visual Studio in order to do it
12 anos atrás
Somebody can help with this for money, please  ?
Send pm
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.