diff --git a/config/routes_website.yaml b/config/routes_website.yaml index e9df8c4..5b60791 100644 --- a/config/routes_website.yaml +++ b/config/routes_website.yaml @@ -1,5 +1,5 @@ # Define your website routes here app.event: - path: /event/{id} + path: /{_locale}/event/{id} controller: App\Controller\EventWebsiteController::indexAction diff --git a/config/webspaces/example.xml b/config/webspaces/example.xml index 6c48607..a7e4987 100644 --- a/config/webspaces/example.xml +++ b/config/webspaces/example.xml @@ -10,6 +10,8 @@ + + @@ -48,22 +50,22 @@ - {host} + {host}/{localization} - {host} + {host}/{localization} - {host} + {host}/{localization} - {host} + {host}/{localization} diff --git a/templates/base.html.twig b/templates/base.html.twig index 88c8edc..3f93571 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -41,6 +41,12 @@ {% endfor %} + + diff --git a/tests/Functional/Controller/EventWebsiteControllerTest.php b/tests/Functional/Controller/EventWebsiteControllerTest.php index 3e24ea1..49b0a79 100644 --- a/tests/Functional/Controller/EventWebsiteControllerTest.php +++ b/tests/Functional/Controller/EventWebsiteControllerTest.php @@ -26,7 +26,7 @@ public function testIndexAction(): void $event = $this->createEvent('Sulu is awesome', 'en'); - $crawler = $client->request('GET', '/event/' . $event->getId()); + $crawler = $client->request('GET', '/en/event/' . $event->getId()); $response = $client->getResponse(); $this->assertInstanceOf(Response::class, $response); diff --git a/tests/Functional/Pages/HomepageTest.php b/tests/Functional/Pages/HomepageTest.php index 74bc3ce..c0c0ac1 100644 --- a/tests/Functional/Pages/HomepageTest.php +++ b/tests/Functional/Pages/HomepageTest.php @@ -45,7 +45,7 @@ public function testHomepage(): void ); $client = $this->createWebsiteClient(); - $crawler = $client->request(Request::METHOD_GET, '/homepage'); + $crawler = $client->request(Request::METHOD_GET, '/en/homepage'); $response = $client->getResponse(); $this->assertInstanceOf(Response::class, $response);