This module generates a meta alternate hreflang URL

This module generates a alternateHreflang URL for every page of your shop. Once activated, you'll find a <link rel="alternate" hreflang=".." href="..." /> tag in the header of your pages.

Installation

Manually

  • Copy the module into <thelia_root>/local/modules/ directory and be sure that the name of the module is AlternateHreflang.
  • Activate it in your thelia administration panel

Composer

Add it in your main thelia composer.json file

composer require thelia/alternate-hreflang-module:~1.1.0

Usage

You just have to activate the module and check the meta tags of your shop.

Generation example

If your current lang is en and your default lang is fr

<link rel="alternate" hreflang="en" href=".... en url" />
<link rel="alternate" hreflang="fr" href=".... fr url" />
<link rel="alternate" hreflang="es" href=".... es url" />
<link rel="alternate" hreflang="it" href=".... it url" />
<link rel="alternate" hreflang="x-default" href=".... fr url" />

If your current lang is fr and your default lang is it

<link rel="alternate" hreflang="fr" href=".... fr url" />
<link rel="alternate" hreflang="en" href=".... en url" />
<link rel="alternate" hreflang="es" href=".... es url" />
<link rel="alternate" hreflang="it" href=".... it url" />
<link rel="alternate" hreflang="x-default" href=".... it url" />

This module generate hreflang only for languages enabled in the backoffice

If you want the locale hreflang="...." on 5 characters, you have to pass the configuration variable hreflangFormat to 1

If your current lang is fr and your default lang is it

<link rel="alternate" hreflang="fr-fr" href=".... fr url" />
<link rel="alternate" hreflang="en-us" href=".... en url" />
<link rel="alternate" hreflang="es-es" href=".... es url" />
<link rel="alternate" hreflang="it-it" href=".... it url" />
<link rel="alternate" hreflang="x-default" href=".... it url" />

Hook

This module uses the hook main.head-bottom

Download
Download

This module generates a meta alternate hreflang URL

Say Hi & Get in Touch

info@thelia.net - +33(0)4 44 05 31 00

Thelia Network English
E-commerce solution

E-commerce software, useful to create and manage online stores, published under a free license. Discover our new version, based on many modern technologies !

Download Thelia
Business

A team of experts at your service.

Showcase

Over 7000 online stores powered by Thelia

Modules

Customize your Thelia.

Openstudio

Thelia editor