Where to configure HOME page title, keywords, description?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I don't see a way that I can configure home page title, keywords and description. The only way I can do it is to set up the default title, default keywords and default description. But this is unacceptable since all the pages will add these default stuff to their meta tags.  Is there a way to have unique meta tag settings for home page?
12 years ago
Follow the next steps:
1. Open \Views\Home\Index.cshtml file (Nop.Web project)
2. Add the following code after initiating 'Layout' property
Html.AddTitleParts("My home page title");
Html.AddMetaDescriptionParts("My meta description");
Html.AddMetaKeywordParts("My meta keywords");
12 years ago
a.m. wrote:
Follow the next steps:
1. Open \Views\Home\Index.cshtml file (Nop.Web project)
2. Add the following code after initiating 'Layout' property
Html.AddTitleParts("My home page title");
Html.AddMetaDescriptionParts("My meta description");
Html.AddMetaKeywordParts("My meta keywords");


Thank you so much for the help. I followed the steps but didn't work.

@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";
Html.AddTitleParts("My home page title");
Html.AddMetaDescriptionParts("My meta description");
Html.AddMetaKeywordParts("My meta keywords");
}

I am using nop no source version.
12 years ago
I've just tested it. It works fine.
12 years ago
a.m. wrote:
I've just tested it. It works fine.


Thanks for confirming that. Now I know why it didn't work. It works only if I use the "/Home/index.cshtml" under the root folder instead of the Theme folder.
12 years ago
Andrei, do you think that some how the code should automatically include whatever SEO settings the admin sets in the HomePageText topic? It is a bit confusing that when you set the SEO settings there that it does not take effect on the home page.
12 years ago
SilhouetteBS wrote:
Andrei, do you think that some how the code should automatically include whatever SEO settings the admin sets in the HomePageText topic?

We have two types of topics:
1. Topics that are rendered as pages. For example, Shipping & Returns. These topics can override page titles and meta info.
2. Topics that are rendered as blocks. For example, 'HomePageText' topic rendered on home page. These topics cannot override page titles and meta info.
12 years ago
Is there any particular reason that certain topics do not override meta data? I would imagine that most people would expect all topics to act the same. I know I did.
12 years ago
SilhouetteBS wrote:
Is there any particular reason that certain topics do not override meta data? I would imagine that most people would expect all topics to act the same. I know I did.

1. There could be several topic blocks on the same page. Which topic title should we use in this case?
2. There could be custom page title and custom topic block title. Which title should we use in this case? For example, 'contact us' page.

So if you know that you want to use topic titles in blocks, then follow the next steps:
1. Open \Views\Topic\TopicBlock.cshtml file (Nop.Web project)
2. Add the following code right below "@model TopicModel":
@{
    if (!Model.IsPasswordProtected)
    {
        Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Title);
        Html.AddMetaDescriptionParts(Model.MetaDescription);
        Html.AddMetaKeywordParts(Model.MetaKeywords);
    }
}
12 years ago
I've been following this thread and am stuck in the position where I would like to be able to use the meta data from the homepage topic block on the home page, but cannot. Is there any way that this can be achieved please?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.