Preview button bring to wrong url with translated page slug

Hello,

Let’s imagine this scenario (quite common) :

Multisite : 2 sites

Here is the page code to handle some achievements :

url = "/realisations/:slug"
layout = "default"
title = "Détail d'une réalisation"

[section record]
handle = "Realisations\Realisation"
identifier = "slug"
value = "{{ :slug }}"
isDefault = 1

[viewBag]
localeUrl[en-gb] = "/achievements/:slug"
==
<?php

?>
==
{% if record is empty %}
    {% do abort(404) %}
{% endif %}
.....

And the blueprint :

uuid: fa0e614c-bb36-4d15-ba10-f6c91f28f096
handle: Realisations\Realisation
type: stream
name: Réalisations
drafts: false
multisite: true

primaryNavigation:
    label: Réalisations
    icon: ph ph-wrench
    order: 800

navigation:
    icon: ph ph-wrench
    parent: Realisations\Realisation
    order: 10


fields:
    ....
  • If I click to the preview button when I select french website, everything is OK. :white_check_mark:
  • If I click to the preview button when I select the english website, I go to a 404 :x:
    That’s because the preview url is https://mywebsite.com/en/realisations/my-achievements
    Instead of https://mywebsite.com/en/achievements/my-achievements

In other words, when I select the english website and click on the preview button, October should take the translated page url instead of the default one.

Best regards,

Hello @Zmove

As-tu essayé

[viewBag]
localeUrl[en] = "/achievements/:slug"

au lieu

[viewBag]
localeUrl[en-gb] = "/achievements/:slug"

[/quote]