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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Change language on current page

Started by Jonathan Schweppe 5 years ago · 0 replies · 379 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 Thomas, 1 week ago
3 90 1 hour ago
Support · by Anna, 3 days ago
2 92 22 hours ago
Support · by Justin Young, 23 hours ago
1 40 23 hours ago
Support · by Duc , 1 week ago
2 98 6 days ago
Support · by Colin Hume, 1 week ago
2 90 6 days ago