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
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! – Marco Schuler Mar 24 '16 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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