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

Imprint link in an multilingual setup

Started by Nico Petri 9 years ago · 1 replies · 808 views
9 years ago

Hello there,

i have a multilingual setup and want to include an imprint link to the footer. So i put this on my footer.html.twig file:

<a href="{{ page.find('/imprint').slug }} ">{{ page.find('/imprint').title }}</a>

But if i ever translate this page the page.find('/imprint') will probably fail. So how did u deal with that? Mayby override the slug in the frontmatter in every single translated file?

Thx in advance.

9 years ago

Grav will find the current translation version of the page, and put the correct URL in that Twig code.

You can also write an if in the Twig, and check for the current active language, and output a different URL.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by FrViPofm, 11 hours ago
0 20 11 hours ago
Themes & Styling · by stuart young, 1 month ago
3 480 1 month ago
Themes & Styling · by Sebadamus, 2 months ago
5 481 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 460 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 490 2 months ago