Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Problems with slugs in multi language website

Started by Muut Archive 10 years ago · 4 replies · 851 views
10 years ago

Hi,
I'm working on a multi-languages site powered by 1.1.5 Grav and something is not working with slugs. I want to follow the approach explained here https://learn.getgrav.org/content/multi-language#multi-language-routing, so I configured the system.yaml as follows:

YAML
languages:
  translations: true
  include_default_lang: false
  supported:
    - it
    - en

then I configured the 'basic.it.md' italian page header as follows:

YAML
title: Il titolo
slug: collezione
menu: Collezione

then the 'basic.en.md' as follows:

YAML
title: The title
slug: collection
menu: Collection 

Next, I added the langswitcher plugin and when I click the English language the browser points to 'en/collezione' route instead of the expected '/collection'

What I'm doing wrong?

10 years ago

LangSwitcher to determine the other page URL uses the raw route (not the slug you defined). You probably have the page folder named /pages/collezione as italian is the default language

10 years ago

Yes, I have a 02.collezione page in my website but, according with Grav documentation, when I configured the switch include default lang the slug /collection without the language, so /en/collection, should exist but it doesn't. Next, the LangSwitcher should point the slug not the raw route.

10 years ago

No one could help? @rhukster @flaviocopes?

9 years ago

Hi, i had the same problem. Try to enable the "redirect default route" (in the configuration) which will redirect to the default route for the page (including custom slugs).

cheers

👍 1

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1345 9 years ago
Archive · by Muut Archive, 9 years ago
2 932 9 years ago
Archive · by Muut Archive, 9 years ago
2 4059 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago