Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Change language on current page

Started by Jonathan Schweppe 5 years ago · 0 replies · 541 views
5 years ago

Hey there, I've build a small box with a german and great britain flag in a Twig Template which I build in on every page.

Now I would like to change the language of the current page if I click on one of the flags.

So I thought href="en" would be the solution. It works fine on the main site, but when I'm on a subpage I get a 404 because of a double language ending in the URL like "www.domain.com/en/en". Is there any possibility that I can set a link with a variable for like "page I'm currently at" and just change the language ending?

last edited 11/11/21 by Jonathan Schweppe

Suggested topics

Topic Participants Replies Views Activity
Support · by webmasterodp, 1 week ago
4 176 1 week ago
Support · by nwhitfield, 1 week ago
2 153 1 week ago
Support · by stell, 3 weeks ago
5 388 2 weeks ago
Support · by gravinator, 1 month ago
5 580 2 weeks ago
Support · by Gravver, 3 weeks ago
6 365 3 weeks ago