Skip to main content
added 1 character in body
Source Link
carlcs
  • 36.4k
  • 5
  • 64
  • 141

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().urislug %} 

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().uri %} 

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 %} 
Source Link
carlcs
  • 36.4k
  • 5
  • 64
  • 141

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().uri %}