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

Change language on current page

Started by Jonathan Schweppe 5 years ago · 0 replies · 473 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 Paul Hodges, 4 weeks ago
19 490 6 days ago
Support · by Lauw, 1 week ago
2 107 1 week ago
Support · by Anna, 3 weeks ago
4 430 1 week ago
Support · by gtx, 4 weeks ago
4 380 3 weeks ago
Support · by Anna, 1 month ago
9 487 4 weeks ago