Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Change language on current page

Started by Jonathan Schweppe 5 years ago · 0 replies · 623 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 TomW, 2 weeks ago
8 228 9 hours ago
Support · by alex, 2 months ago
8 667 1 day ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 160 3 days ago
Support · by TomW, 6 days ago
2 106 6 days ago