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

Imprint link in an multilingual setup

Started by Nico Petri 9 years ago · 1 replies · 752 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 Sebadamus, 7 days ago
5 148 14 hours ago
Themes & Styling · by martynfoster735, 1 week ago
1 192 1 week ago
Themes & Styling · by Justin Young, 3 weeks ago
1 241 3 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 376 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 745 3 months ago