3

in a multilingual site, how can i place multilingual links to content.

i.e. in the footer i would place a Imprint but in anohter language the slug might be /de/germanImprint...is there an easy helper to always get the right url from the english slug?

nexflo
  • 539
  • 4
  • 13

1 Answers1

3

This is how to "translate" a slug:

{% set enSlug = 'work' %}

{# Get the ID of an entry with that english slug #}
{% set enId = craft.entries.slug(enSlug).locale('en').first().id %}

{# Use the entry ID to get the german slug #}
{% set deSlug = craft.entries.id(enId).locale('de').first().slug %}
carlcs
  • 36,220
  • 5
  • 62
  • 139