Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Change language on current page

Started by Jonathan Schweppe 5 years ago · 0 replies · 506 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 blu3prince, 4 days ago
1 84 14 hours ago
Support · by complanar, 7 days ago
6 165 2 days ago
Support · by Rick Beebe, 1 week ago
2 123 4 days ago
Support · by alex, 5 days ago
2 107 4 days ago
Support · by Marcel, 2 weeks ago
1 156 5 days ago