2

I'm setting up my first multilingual website with Craft. I'm struggling with multilingual slugs.

This is how I'd like the slugs to look like.

enter image description here

If I do this tough, I need to adapt my folder structure. To get it working I needed to create folder structure like this

/fr/nouvelles/
/en/news/

both containing the same templates.

Is it possible to get this working without needing to copy the templates? I'd like to always load the same template(/news/), without the language specific folder structure.

0

1 Answer 1

4

The problem you're probably facing isn't that URLs like

http://example.com/en/news/example
http://example.com/fr/nouvelles/exemple

don't work, but that you're not getting the sections' index pages to load because they're just a index.html file in your templates/news/ folder (→ routing case 6 in https://craftcms.com/docs/routing).

For a multi locale setup with translated slugs it's recommended to not rely on "URI to template matching" at all and create an entry or category for every page, so Craft sets up the routes for all the translated slugs automatically (→ routing case 4).

In your case you'd just create an entry for your News index page, e.g through a single section. In the single section's settings set up the URLs for your locales and route them to your template.

1
  • Using a single section for the overview page did the job for me. Thank you for your support! Mar 24, 2016 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.