Cannot Edit SEO On Contact Us Page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
It seems the ContactUs page (System Name) will always use the store SEO rather than specified SEO.

Has anyone else noticed this?

I noticed when you customize this page you get an URL like this

/contactus-2

Which if you go to directly shows the correct SEO.

However if you go to

/contactus

You see the content that you edited along with the form but no customized SEO.
7 years ago
But you cannot edit "contact us" page URL (it's not allowed without source code customization. I presume you edited the topic (just a text)

Please provide a list of steps to reproduce the issue
7 years ago
Go to content pages > Topics > ContactUs.

Change the text, then go to SEO tab and change the SEO.

Now go to the public store. You will see the text on the contact us page has changed however the SEO has not changed and is still using the default store SEO.
7 years ago
Hi. I'm becoming crazy with contactus (page, form .... )

I know that contactus is a View contained in common folder of Nopcommerce source.

So i don't remember how and when but what i have now is: i can't show contactus link in main menu.

I tried to insert a new topic called contactus (systemname) but the SEO name after saving change in contact-us2 ...3 ... 4 ... and so on.

The URLRecord table in database contain the slug field that would be the seoname: is this correct?

So if delete the url-record and the all the contact-us page created is ever the same: the topic is changed and obviously don't link the contactus view.

Any suggestions? what the hell i have to do?

REgards, Massimo
7 years ago
[email protected] wrote:
It seems the ContactUs page (System Name) will always use the store SEO rather than specified SEO.

Has anyone else noticed this?

I noticed when you customize this page you get an URL like this

/contactus-2

Which if you go to directly shows the correct SEO.

However if you go to

/contactus

You see the content that you edited along with the form but no customized SEO.


Here's what I did to have special meta description and meta keywords on my contact page:

On the /Views/Shared/_Root.Head.cshtml  (or same file, but in your custom theme folder):

I replaced this:
  <meta name="description" content="@(Html.NopMetaDescription())" />
  <meta name="keywords" content="@(Html.NopMetaKeywords())" />

with this:

@if (Model.Title == "Contact Us")
{
  <meta name="description" content="Your static text goes here..." />
  <meta name="keywords" content="these,are,keywords,here," />
}
else
{
  <meta name="description" content="@(Html.NopMetaDescription())" />
  <meta name="keywords" content="@(Html.NopMetaKeywords())" />
}


It will work in version 3.40..I have not tested in other versions, but it will probably also work in other versions. Just be sure to use whatever your actual title is for the ContactUs topic page.
7 years ago
embryo wrote:

It will work in version 3.40..I have not tested in other versions, but it will probably also work in other versions. Just be sure to use whatever your actual title is for the ContactUs topic page.


But, if it doesn't work, you could try this instead:

string currentpage=HttpContext.Current.Request.ServerVariables["PATH_INFO"];
@if (currentpage == "/contactus")
{
  <meta name="description" content="Your static text goes here..." />
  <meta name="keywords" content="these,are,keywords,here," />
}
else
{
  <meta name="description" content="@(Html.NopMetaDescription())" />
  <meta name="keywords" content="@(Html.NopMetaKeywords())" />
}
7 years ago
Hi. thanks for your answer.

I know that i can change the source ... but that change will be overrided when in future we will upgrade NOP.

So ... this it seems to me that this is an hard code problem ...

ANy other suggestions?
7 years ago
mystones wrote:
Hi. thanks for your answer.

I know that i can change the source ... but that change will be overrided when in future we will upgrade NOP.

So ... this it seems to me that this is an hard code problem ...

ANy other suggestions?


A modification of the core DLL will also cause you to lose your changes on upgrade, so the only option is to wait for a future version of nopCommerce that includes this as a native feature.

Editing the view is really basic. It's not like modifying the project in Visual Studio...but more like editing basic HTML which you can do with Notepad.
You just have to remember to save a copy of your modified views when you do the next upgrade and copy back in to site when finished...
6 years ago
I just spent some time going through the forums with the whole contact us debacle. This issue still exists in 3.90.

I have figured out that the contactus-2 is just a way to inject html into the contactus page. So you can change the SEO on the Contact Us topic till you are blue in the face. However, the contactus page will always inherit the store SEO. I understand that its probably not that critical but there should be some consistency.

I also just discovered that the /productreviews/* and /newproducts/* pages all inherit the store default meta description. The meta titles for the products are injected just fine. Why not the meta descriptions?

Regards
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.