blooparksystems / website

Odoo Website builder related addons
GNU Affero General Public License v3.0
10 stars 33 forks source link

add support for canonical tag #15

Closed jholze closed 9 years ago

jholze commented 9 years ago

Description

Basically, it makes sense to add the canonical tag on each page of a website that each page points to itself. This prevents unexpected errors and incorrect links. If duplicate content exists the canonical tag points always to the original page.

Reason

The Google search engine rates duplicate content negative because no relevant value exists for the users / internet.

Example

<link rel=“canonical“ href=“http://www.example.de/example.htm"/>.

current behavior

Currently we have no canonical tag in odoo.

expected behavior

We need a canonical tag on each page of a website, so that each page points to itself. The canonical tag is located in the HEAD of a page.

Example

<link rel=“canonical“ href=“http://www.example.de/example.htm"/>.
kaerdsar commented 9 years ago

I added the canonical tag in link into HEAD element in view. I have a couple of questions:

  1. Now you can see: -- link rel="canonical" .... -- link rel="alternate" hreflang="en" ... -- link rel="alternate" hreflang="de" ... Is this correct? Do we need a link for canonical and one link for each language?
  2. If the URL for language "en" is different that the URL for language "de", what must be appear in link with tag rel="canonical" ?

Also we have to fix links tags in HEAD. Now if you have a seo_url with a value in english an other in german, the link tags does not show translated URL and if you click get page 404.

fczaja commented 9 years ago
  1. The canonical link element must be available for each language version. The two alternate hreflang must be in both language versions are available.
  2. DE and EN have different URL in the canonical link element so they show in their own language version.
rruebner commented 9 years ago

@kaerdsar Please see my comment in the first commit. The rest is fine.

rruebner commented 9 years ago

Review was fine :+1: